Merge pull request #56 from NotAShelf/notashelf/push-umuwyuqntslp

various: bump dependencies
This commit is contained in:
raf 2025-12-22 17:14:53 +03:00 committed by GitHub
commit 1f0312b2f6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 125 additions and 40 deletions

108
Cargo.lock generated
View file

@ -296,6 +296,12 @@ dependencies = [
"piper",
]
[[package]]
name = "bumpalo"
version = "3.19.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510"
[[package]]
name = "cassowary"
version = "0.3.0"
@ -776,6 +782,12 @@ version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2"
[[package]]
name = "foldhash"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"
[[package]]
name = "futures-core"
version = "0.3.31"
@ -838,22 +850,25 @@ checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
dependencies = [
"allocator-api2",
"equivalent",
"foldhash",
"foldhash 0.1.5",
]
[[package]]
name = "hashbrown"
version = "0.16.0"
version = "0.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d"
checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
dependencies = [
"foldhash 0.2.0",
]
[[package]]
name = "hashlink"
version = "0.10.0"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1"
checksum = "ea0b22561a9c04a7cb1a302c013e0259cd3b4bb619f145b32f72b8b4bcbed230"
dependencies = [
"hashbrown 0.15.5",
"hashbrown 0.16.1",
]
[[package]]
@ -899,7 +914,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b0f83760fb341a774ed326568e19f5a863af4a952def8c39f9ab92fd95b88e5"
dependencies = [
"equivalent",
"hashbrown 0.16.0",
"hashbrown 0.15.5",
]
[[package]]
@ -979,6 +994,16 @@ dependencies = [
"syn",
]
[[package]]
name = "js-sys"
version = "0.3.83"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "464a3709c7f55f1f721e5389aa6ea4e3bc6aba669353300af094b29ffbdde1d8"
dependencies = [
"once_cell",
"wasm-bindgen",
]
[[package]]
name = "lazy_static"
version = "1.5.0"
@ -1003,9 +1028,9 @@ dependencies = [
[[package]]
name = "libsqlite3-sys"
version = "0.35.0"
version = "0.36.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "133c182a6a2c87864fe97778797e46c7e999672690dc9fa3ee8e241aa4a9c13f"
checksum = "95b4103cffefa72eb8428cb6b47d6627161e51c2739fc5e3b734584157bc642a"
dependencies = [
"cc",
"pkg-config",
@ -1460,9 +1485,9 @@ checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58"
[[package]]
name = "rusqlite"
version = "0.37.0"
version = "0.38.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "165ca6e57b20e1351573e3729b958bc62f0e48025386970b6e4d29e7a7e71f3f"
checksum = "f1c93dd1c9683b438c392c492109cb702b8090b2bfc8fed6f6e4eb4523f17af3"
dependencies = [
"bitflags",
"fallible-iterator",
@ -1470,6 +1495,7 @@ dependencies = [
"hashlink",
"libsqlite3-sys",
"smallvec",
"sqlite-wasm-rs",
]
[[package]]
@ -1650,9 +1676,22 @@ dependencies = [
"futures-lite",
]
[[package]]
name = "sqlite-wasm-rs"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05e98301bf8b0540c7de45ecd760539b9c62f5772aed172f08efba597c11cd5d"
dependencies = [
"cc",
"hashbrown 0.16.1",
"js-sys",
"thiserror",
"wasm-bindgen",
]
[[package]]
name = "stash-clipboard"
version = "0.3.2"
version = "0.3.3"
dependencies = [
"base64",
"clap",
@ -1982,6 +2021,51 @@ dependencies = [
"wit-bindgen",
]
[[package]]
name = "wasm-bindgen"
version = "0.2.106"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d759f433fa64a2d763d1340820e46e111a7a5ab75f993d1852d70b03dbb80fd"
dependencies = [
"cfg-if",
"once_cell",
"rustversion",
"wasm-bindgen-macro",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.106"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "48cb0d2638f8baedbc542ed444afc0644a29166f1595371af4fecf8ce1e7eeb3"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
]
[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.106"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cefb59d5cd5f92d9dcf80e4683949f15ca4b511f4ac0a6e14d4e1ac60c6ecd40"
dependencies = [
"bumpalo",
"proc-macro2",
"quote",
"syn",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.106"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cbc538057e648b67f72a982e708d485b2efa771e1ac05fec311f9f63e5800db4"
dependencies = [
"unicode-ident",
]
[[package]]
name = "wayland-backend"
version = "0.3.11"

View file

@ -1,13 +1,13 @@
[package]
name = "stash-clipboard"
description = "Wayland clipboard manager with fast persistent history and multi-media support"
version = "0.3.2"
version = "0.3.3"
edition = "2024"
authors = ["NotAShelf <raf@notashelf.dev>"]
license = "MPL-2.0"
readme = true
repository = "https://github.com/notashelf/stash"
rust-version = "1.85"
rust-version = "1.90"
[[bin]]
name = "stash" # actual binary name for Nix, Cargo, etc.
@ -33,7 +33,7 @@ log = "0.4.28"
env_logger = "0.11.8"
thiserror = "2.0.17"
wl-clipboard-rs = "0.9.2"
rusqlite = { version = "0.37.0", features = ["bundled"] }
rusqlite = { version = "0.38.0", features = ["bundled"] }
smol = "2.0.2"
serde = { version = "1.0.228", features = ["derive"] }
serde_json = "1.0.145"

12
flake.lock generated
View file

@ -2,11 +2,11 @@
"nodes": {
"crane": {
"locked": {
"lastModified": 1754269165,
"narHash": "sha256-0tcS8FHd4QjbCVoxN9jI+PjHgA4vc/IjkUSp+N3zy0U=",
"lastModified": 1766194365,
"narHash": "sha256-4AFsUZ0kl6MXSm4BaQgItD0VGlEKR3iq7gIaL7TjBvc=",
"owner": "ipetkov",
"repo": "crane",
"rev": "444e81206df3f7d92780680e45858e31d2f07a08",
"rev": "7d8ec2c71771937ab99790b45e6d9b93d15d9379",
"type": "github"
},
"original": {
@ -17,11 +17,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1754725699,
"narHash": "sha256-iAcj9T/Y+3DBy2J0N+yF9XQQQ8IEb5swLFzs23CdP88=",
"lastModified": 1766309749,
"narHash": "sha256-3xY8CZ4rSnQ0NqGhMKAy5vgC+2IVK0NoVEzDoOh4DA4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "85dbfc7aaf52ecb755f87e577ddbe6dbbdbc1054",
"rev": "a6531044f6d0bef691ea18d4d4ce44d0daa6e816",
"type": "github"
},
"original": {

View file

@ -61,14 +61,14 @@ impl SqliteClipboardDb {
.query([])
.map_err(|e| StashError::ListDecode(e.to_string().into()))?;
let mut entries: Vec<(u64, String, String)> = Vec::new();
let mut entries: Vec<(i64, String, String)> = Vec::new();
let mut max_id_width = 2;
let mut max_mime_width = 8;
while let Some(row) = rows
.next()
.map_err(|e| StashError::ListDecode(e.to_string().into()))?
{
let id: u64 = row
let id: i64 = row
.get(0)
.map_err(|e| StashError::ListDecode(e.to_string().into()))?;
let contents: Vec<u8> = row

View file

@ -56,7 +56,7 @@ pub enum StashError {
#[error("Failed to delete entry during query delete: {0}")]
QueryDelete(Box<str>),
#[error("Failed to delete entry with id {0}: {1}")]
DeleteEntry(u64, Box<str>),
DeleteEntry(i64, Box<str>),
}
pub trait ClipboardDb {
@ -66,7 +66,7 @@ pub trait ClipboardDb {
max_dedupe_search: u64,
max_items: u64,
excluded_apps: Option<&[String]>,
) -> Result<u64, StashError>;
) -> Result<i64, StashError>;
fn deduplicate_by_hash(
&self,
@ -89,7 +89,7 @@ pub trait ClipboardDb {
) -> Result<(), StashError>;
fn delete_query(&self, query: &str) -> Result<usize, StashError>;
fn delete_entries(&self, input: impl Read) -> Result<usize, StashError>;
fn next_sequence(&self) -> u64;
fn next_sequence(&self) -> i64;
}
#[derive(Serialize, Deserialize)]
@ -184,7 +184,7 @@ impl SqliteClipboardDb {
.next()
.map_err(|e| StashError::ListDecode(e.to_string().into()))?
{
let id: u64 = row
let id: i64 = row
.get(0)
.map_err(|e| StashError::ListDecode(e.to_string().into()))?;
let contents: Vec<u8> = row
@ -219,7 +219,7 @@ impl ClipboardDb for SqliteClipboardDb {
max_dedupe_search: u64,
max_items: u64,
excluded_apps: Option<&[String]>,
) -> Result<u64, StashError> {
) -> Result<i64, StashError> {
let mut buf = Vec::new();
if input.read_to_end(&mut buf).is_err()
|| buf.is_empty()
@ -297,7 +297,7 @@ impl ClipboardDb for SqliteClipboardDb {
.next()
.map_err(|e| StashError::DeduplicationRead(e.to_string().into()))?
{
let id: u64 = row
let id: i64 = row
.get(0)
.map_err(|e| StashError::DeduplicationDecode(e.to_string().into()))?;
self
@ -310,12 +310,13 @@ impl ClipboardDb for SqliteClipboardDb {
}
fn trim_db(&self, max: u64) -> Result<(), StashError> {
let count: u64 = self
let count: i64 = self
.conn
.query_row("SELECT COUNT(*) FROM clipboard", [], |row| row.get(0))
.map_err(|e| StashError::Trim(e.to_string().into()))?;
if count > max {
let to_delete = count - max;
let max_i64 = i64::try_from(max).unwrap_or(i64::MAX);
if count > max_i64 {
let to_delete = count - max_i64;
self
.conn
.execute(
@ -329,7 +330,7 @@ impl ClipboardDb for SqliteClipboardDb {
}
fn delete_last(&self) -> Result<(), StashError> {
let id: Option<u64> = self
let id: Option<i64> = self
.conn
.query_row(
"SELECT id FROM clipboard ORDER BY id DESC LIMIT 1",
@ -379,7 +380,7 @@ impl ClipboardDb for SqliteClipboardDb {
.next()
.map_err(|e| StashError::ListDecode(e.to_string().into()))?
{
let id: u64 = row
let id: i64 = row
.get(0)
.map_err(|e| StashError::ListDecode(e.to_string().into()))?;
let contents: Vec<u8> = row
@ -413,7 +414,7 @@ impl ClipboardDb for SqliteClipboardDb {
.map_err(|e| StashError::DecodeExtractId(e.to_string().into()))?;
buf
};
let id = extract_id(&input_str)
let id: i64 = extract_id(&input_str)
.map_err(|e| StashError::DecodeExtractId(e.into()))?;
let (contents, _mime): (Vec<u8>, Option<String>) = self
.conn
@ -443,7 +444,7 @@ impl ClipboardDb for SqliteClipboardDb {
.next()
.map_err(|e| StashError::QueryDelete(e.to_string().into()))?
{
let id: u64 = row
let id: i64 = row
.get(0)
.map_err(|e| StashError::QueryDelete(e.to_string().into()))?;
let contents: Vec<u8> = row
@ -475,11 +476,11 @@ impl ClipboardDb for SqliteClipboardDb {
Ok(deleted)
}
fn next_sequence(&self) -> u64 {
fn next_sequence(&self) -> i64 {
match self
.conn
.query_row("SELECT MAX(id) FROM clipboard", [], |row| {
row.get::<_, Option<u64>>(0)
row.get::<_, Option<i64>>(0)
}) {
Ok(Some(max_id)) => max_id + 1,
Ok(None) | Err(_) => 1,
@ -519,7 +520,7 @@ fn load_sensitive_regex() -> Option<Regex> {
REGEX_CACHE.get().and_then(std::clone::Clone::clone)
}
pub fn extract_id(input: &str) -> Result<u64, &'static str> {
pub fn extract_id(input: &str) -> Result<i64, &'static str> {
let id_str = input.split('\t').next().unwrap_or("");
id_str.parse().map_err(|_| "invalid id")
}

View file

@ -66,7 +66,7 @@ struct WlPasteArgs {
watch: Option<Vec<String>>,
}
fn get_paste_mime_type(mime_arg: Option<&str>) -> PasteMimeType {
fn get_paste_mime_type(mime_arg: Option<&str>) -> PasteMimeType<'_> {
match mime_arg {
None | Some("text" | "autodetect") => PasteMimeType::Text,
Some(other) => PasteMimeType::Specific(other),