mirror of
https://github.com/NotAShelf/stash.git
synced 2026-04-13 14:33:47 +00:00
Merge pull request #56 from NotAShelf/notashelf/push-umuwyuqntslp
various: bump dependencies
This commit is contained in:
commit
1f0312b2f6
6 changed files with 125 additions and 40 deletions
108
Cargo.lock
generated
108
Cargo.lock
generated
|
|
@ -296,6 +296,12 @@ dependencies = [
|
||||||
"piper",
|
"piper",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "bumpalo"
|
||||||
|
version = "3.19.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cassowary"
|
name = "cassowary"
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
|
|
@ -776,6 +782,12 @@ version = "0.1.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2"
|
checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "foldhash"
|
||||||
|
version = "0.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "futures-core"
|
name = "futures-core"
|
||||||
version = "0.3.31"
|
version = "0.3.31"
|
||||||
|
|
@ -838,22 +850,25 @@ checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"allocator-api2",
|
"allocator-api2",
|
||||||
"equivalent",
|
"equivalent",
|
||||||
"foldhash",
|
"foldhash 0.1.5",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hashbrown"
|
name = "hashbrown"
|
||||||
version = "0.16.0"
|
version = "0.16.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d"
|
checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
|
||||||
|
dependencies = [
|
||||||
|
"foldhash 0.2.0",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hashlink"
|
name = "hashlink"
|
||||||
version = "0.10.0"
|
version = "0.11.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1"
|
checksum = "ea0b22561a9c04a7cb1a302c013e0259cd3b4bb619f145b32f72b8b4bcbed230"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"hashbrown 0.15.5",
|
"hashbrown 0.16.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
@ -899,7 +914,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4b0f83760fb341a774ed326568e19f5a863af4a952def8c39f9ab92fd95b88e5"
|
checksum = "4b0f83760fb341a774ed326568e19f5a863af4a952def8c39f9ab92fd95b88e5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"equivalent",
|
"equivalent",
|
||||||
"hashbrown 0.16.0",
|
"hashbrown 0.15.5",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
@ -979,6 +994,16 @@ dependencies = [
|
||||||
"syn",
|
"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]]
|
[[package]]
|
||||||
name = "lazy_static"
|
name = "lazy_static"
|
||||||
version = "1.5.0"
|
version = "1.5.0"
|
||||||
|
|
@ -1003,9 +1028,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libsqlite3-sys"
|
name = "libsqlite3-sys"
|
||||||
version = "0.35.0"
|
version = "0.36.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "133c182a6a2c87864fe97778797e46c7e999672690dc9fa3ee8e241aa4a9c13f"
|
checksum = "95b4103cffefa72eb8428cb6b47d6627161e51c2739fc5e3b734584157bc642a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cc",
|
"cc",
|
||||||
"pkg-config",
|
"pkg-config",
|
||||||
|
|
@ -1460,9 +1485,9 @@ checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rusqlite"
|
name = "rusqlite"
|
||||||
version = "0.37.0"
|
version = "0.38.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "165ca6e57b20e1351573e3729b958bc62f0e48025386970b6e4d29e7a7e71f3f"
|
checksum = "f1c93dd1c9683b438c392c492109cb702b8090b2bfc8fed6f6e4eb4523f17af3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"fallible-iterator",
|
"fallible-iterator",
|
||||||
|
|
@ -1470,6 +1495,7 @@ dependencies = [
|
||||||
"hashlink",
|
"hashlink",
|
||||||
"libsqlite3-sys",
|
"libsqlite3-sys",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
|
"sqlite-wasm-rs",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
@ -1650,9 +1676,22 @@ dependencies = [
|
||||||
"futures-lite",
|
"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]]
|
[[package]]
|
||||||
name = "stash-clipboard"
|
name = "stash-clipboard"
|
||||||
version = "0.3.2"
|
version = "0.3.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64",
|
"base64",
|
||||||
"clap",
|
"clap",
|
||||||
|
|
@ -1982,6 +2021,51 @@ dependencies = [
|
||||||
"wit-bindgen",
|
"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]]
|
[[package]]
|
||||||
name = "wayland-backend"
|
name = "wayland-backend"
|
||||||
version = "0.3.11"
|
version = "0.3.11"
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
[package]
|
[package]
|
||||||
name = "stash-clipboard"
|
name = "stash-clipboard"
|
||||||
description = "Wayland clipboard manager with fast persistent history and multi-media support"
|
description = "Wayland clipboard manager with fast persistent history and multi-media support"
|
||||||
version = "0.3.2"
|
version = "0.3.3"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
authors = ["NotAShelf <raf@notashelf.dev>"]
|
authors = ["NotAShelf <raf@notashelf.dev>"]
|
||||||
license = "MPL-2.0"
|
license = "MPL-2.0"
|
||||||
readme = true
|
readme = true
|
||||||
repository = "https://github.com/notashelf/stash"
|
repository = "https://github.com/notashelf/stash"
|
||||||
rust-version = "1.85"
|
rust-version = "1.90"
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "stash" # actual binary name for Nix, Cargo, etc.
|
name = "stash" # actual binary name for Nix, Cargo, etc.
|
||||||
|
|
@ -33,7 +33,7 @@ log = "0.4.28"
|
||||||
env_logger = "0.11.8"
|
env_logger = "0.11.8"
|
||||||
thiserror = "2.0.17"
|
thiserror = "2.0.17"
|
||||||
wl-clipboard-rs = "0.9.2"
|
wl-clipboard-rs = "0.9.2"
|
||||||
rusqlite = { version = "0.37.0", features = ["bundled"] }
|
rusqlite = { version = "0.38.0", features = ["bundled"] }
|
||||||
smol = "2.0.2"
|
smol = "2.0.2"
|
||||||
serde = { version = "1.0.228", features = ["derive"] }
|
serde = { version = "1.0.228", features = ["derive"] }
|
||||||
serde_json = "1.0.145"
|
serde_json = "1.0.145"
|
||||||
|
|
|
||||||
12
flake.lock
generated
12
flake.lock
generated
|
|
@ -2,11 +2,11 @@
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"crane": {
|
"crane": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1754269165,
|
"lastModified": 1766194365,
|
||||||
"narHash": "sha256-0tcS8FHd4QjbCVoxN9jI+PjHgA4vc/IjkUSp+N3zy0U=",
|
"narHash": "sha256-4AFsUZ0kl6MXSm4BaQgItD0VGlEKR3iq7gIaL7TjBvc=",
|
||||||
"owner": "ipetkov",
|
"owner": "ipetkov",
|
||||||
"repo": "crane",
|
"repo": "crane",
|
||||||
"rev": "444e81206df3f7d92780680e45858e31d2f07a08",
|
"rev": "7d8ec2c71771937ab99790b45e6d9b93d15d9379",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -17,11 +17,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1754725699,
|
"lastModified": 1766309749,
|
||||||
"narHash": "sha256-iAcj9T/Y+3DBy2J0N+yF9XQQQ8IEb5swLFzs23CdP88=",
|
"narHash": "sha256-3xY8CZ4rSnQ0NqGhMKAy5vgC+2IVK0NoVEzDoOh4DA4=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "85dbfc7aaf52ecb755f87e577ddbe6dbbdbc1054",
|
"rev": "a6531044f6d0bef691ea18d4d4ce44d0daa6e816",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
||||||
|
|
@ -61,14 +61,14 @@ impl SqliteClipboardDb {
|
||||||
.query([])
|
.query([])
|
||||||
.map_err(|e| StashError::ListDecode(e.to_string().into()))?;
|
.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_id_width = 2;
|
||||||
let mut max_mime_width = 8;
|
let mut max_mime_width = 8;
|
||||||
while let Some(row) = rows
|
while let Some(row) = rows
|
||||||
.next()
|
.next()
|
||||||
.map_err(|e| StashError::ListDecode(e.to_string().into()))?
|
.map_err(|e| StashError::ListDecode(e.to_string().into()))?
|
||||||
{
|
{
|
||||||
let id: u64 = row
|
let id: i64 = row
|
||||||
.get(0)
|
.get(0)
|
||||||
.map_err(|e| StashError::ListDecode(e.to_string().into()))?;
|
.map_err(|e| StashError::ListDecode(e.to_string().into()))?;
|
||||||
let contents: Vec<u8> = row
|
let contents: Vec<u8> = row
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ pub enum StashError {
|
||||||
#[error("Failed to delete entry during query delete: {0}")]
|
#[error("Failed to delete entry during query delete: {0}")]
|
||||||
QueryDelete(Box<str>),
|
QueryDelete(Box<str>),
|
||||||
#[error("Failed to delete entry with id {0}: {1}")]
|
#[error("Failed to delete entry with id {0}: {1}")]
|
||||||
DeleteEntry(u64, Box<str>),
|
DeleteEntry(i64, Box<str>),
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait ClipboardDb {
|
pub trait ClipboardDb {
|
||||||
|
|
@ -66,7 +66,7 @@ pub trait ClipboardDb {
|
||||||
max_dedupe_search: u64,
|
max_dedupe_search: u64,
|
||||||
max_items: u64,
|
max_items: u64,
|
||||||
excluded_apps: Option<&[String]>,
|
excluded_apps: Option<&[String]>,
|
||||||
) -> Result<u64, StashError>;
|
) -> Result<i64, StashError>;
|
||||||
|
|
||||||
fn deduplicate_by_hash(
|
fn deduplicate_by_hash(
|
||||||
&self,
|
&self,
|
||||||
|
|
@ -89,7 +89,7 @@ pub trait ClipboardDb {
|
||||||
) -> Result<(), StashError>;
|
) -> Result<(), StashError>;
|
||||||
fn delete_query(&self, query: &str) -> Result<usize, StashError>;
|
fn delete_query(&self, query: &str) -> Result<usize, StashError>;
|
||||||
fn delete_entries(&self, input: impl Read) -> 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)]
|
#[derive(Serialize, Deserialize)]
|
||||||
|
|
@ -184,7 +184,7 @@ impl SqliteClipboardDb {
|
||||||
.next()
|
.next()
|
||||||
.map_err(|e| StashError::ListDecode(e.to_string().into()))?
|
.map_err(|e| StashError::ListDecode(e.to_string().into()))?
|
||||||
{
|
{
|
||||||
let id: u64 = row
|
let id: i64 = row
|
||||||
.get(0)
|
.get(0)
|
||||||
.map_err(|e| StashError::ListDecode(e.to_string().into()))?;
|
.map_err(|e| StashError::ListDecode(e.to_string().into()))?;
|
||||||
let contents: Vec<u8> = row
|
let contents: Vec<u8> = row
|
||||||
|
|
@ -219,7 +219,7 @@ impl ClipboardDb for SqliteClipboardDb {
|
||||||
max_dedupe_search: u64,
|
max_dedupe_search: u64,
|
||||||
max_items: u64,
|
max_items: u64,
|
||||||
excluded_apps: Option<&[String]>,
|
excluded_apps: Option<&[String]>,
|
||||||
) -> Result<u64, StashError> {
|
) -> Result<i64, StashError> {
|
||||||
let mut buf = Vec::new();
|
let mut buf = Vec::new();
|
||||||
if input.read_to_end(&mut buf).is_err()
|
if input.read_to_end(&mut buf).is_err()
|
||||||
|| buf.is_empty()
|
|| buf.is_empty()
|
||||||
|
|
@ -297,7 +297,7 @@ impl ClipboardDb for SqliteClipboardDb {
|
||||||
.next()
|
.next()
|
||||||
.map_err(|e| StashError::DeduplicationRead(e.to_string().into()))?
|
.map_err(|e| StashError::DeduplicationRead(e.to_string().into()))?
|
||||||
{
|
{
|
||||||
let id: u64 = row
|
let id: i64 = row
|
||||||
.get(0)
|
.get(0)
|
||||||
.map_err(|e| StashError::DeduplicationDecode(e.to_string().into()))?;
|
.map_err(|e| StashError::DeduplicationDecode(e.to_string().into()))?;
|
||||||
self
|
self
|
||||||
|
|
@ -310,12 +310,13 @@ impl ClipboardDb for SqliteClipboardDb {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn trim_db(&self, max: u64) -> Result<(), StashError> {
|
fn trim_db(&self, max: u64) -> Result<(), StashError> {
|
||||||
let count: u64 = self
|
let count: i64 = self
|
||||||
.conn
|
.conn
|
||||||
.query_row("SELECT COUNT(*) FROM clipboard", [], |row| row.get(0))
|
.query_row("SELECT COUNT(*) FROM clipboard", [], |row| row.get(0))
|
||||||
.map_err(|e| StashError::Trim(e.to_string().into()))?;
|
.map_err(|e| StashError::Trim(e.to_string().into()))?;
|
||||||
if count > max {
|
let max_i64 = i64::try_from(max).unwrap_or(i64::MAX);
|
||||||
let to_delete = count - max;
|
if count > max_i64 {
|
||||||
|
let to_delete = count - max_i64;
|
||||||
self
|
self
|
||||||
.conn
|
.conn
|
||||||
.execute(
|
.execute(
|
||||||
|
|
@ -329,7 +330,7 @@ impl ClipboardDb for SqliteClipboardDb {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn delete_last(&self) -> Result<(), StashError> {
|
fn delete_last(&self) -> Result<(), StashError> {
|
||||||
let id: Option<u64> = self
|
let id: Option<i64> = self
|
||||||
.conn
|
.conn
|
||||||
.query_row(
|
.query_row(
|
||||||
"SELECT id FROM clipboard ORDER BY id DESC LIMIT 1",
|
"SELECT id FROM clipboard ORDER BY id DESC LIMIT 1",
|
||||||
|
|
@ -379,7 +380,7 @@ impl ClipboardDb for SqliteClipboardDb {
|
||||||
.next()
|
.next()
|
||||||
.map_err(|e| StashError::ListDecode(e.to_string().into()))?
|
.map_err(|e| StashError::ListDecode(e.to_string().into()))?
|
||||||
{
|
{
|
||||||
let id: u64 = row
|
let id: i64 = row
|
||||||
.get(0)
|
.get(0)
|
||||||
.map_err(|e| StashError::ListDecode(e.to_string().into()))?;
|
.map_err(|e| StashError::ListDecode(e.to_string().into()))?;
|
||||||
let contents: Vec<u8> = row
|
let contents: Vec<u8> = row
|
||||||
|
|
@ -413,7 +414,7 @@ impl ClipboardDb for SqliteClipboardDb {
|
||||||
.map_err(|e| StashError::DecodeExtractId(e.to_string().into()))?;
|
.map_err(|e| StashError::DecodeExtractId(e.to_string().into()))?;
|
||||||
buf
|
buf
|
||||||
};
|
};
|
||||||
let id = extract_id(&input_str)
|
let id: i64 = extract_id(&input_str)
|
||||||
.map_err(|e| StashError::DecodeExtractId(e.into()))?;
|
.map_err(|e| StashError::DecodeExtractId(e.into()))?;
|
||||||
let (contents, _mime): (Vec<u8>, Option<String>) = self
|
let (contents, _mime): (Vec<u8>, Option<String>) = self
|
||||||
.conn
|
.conn
|
||||||
|
|
@ -443,7 +444,7 @@ impl ClipboardDb for SqliteClipboardDb {
|
||||||
.next()
|
.next()
|
||||||
.map_err(|e| StashError::QueryDelete(e.to_string().into()))?
|
.map_err(|e| StashError::QueryDelete(e.to_string().into()))?
|
||||||
{
|
{
|
||||||
let id: u64 = row
|
let id: i64 = row
|
||||||
.get(0)
|
.get(0)
|
||||||
.map_err(|e| StashError::QueryDelete(e.to_string().into()))?;
|
.map_err(|e| StashError::QueryDelete(e.to_string().into()))?;
|
||||||
let contents: Vec<u8> = row
|
let contents: Vec<u8> = row
|
||||||
|
|
@ -475,11 +476,11 @@ impl ClipboardDb for SqliteClipboardDb {
|
||||||
Ok(deleted)
|
Ok(deleted)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn next_sequence(&self) -> u64 {
|
fn next_sequence(&self) -> i64 {
|
||||||
match self
|
match self
|
||||||
.conn
|
.conn
|
||||||
.query_row("SELECT MAX(id) FROM clipboard", [], |row| {
|
.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(Some(max_id)) => max_id + 1,
|
||||||
Ok(None) | Err(_) => 1,
|
Ok(None) | Err(_) => 1,
|
||||||
|
|
@ -519,7 +520,7 @@ fn load_sensitive_regex() -> Option<Regex> {
|
||||||
REGEX_CACHE.get().and_then(std::clone::Clone::clone)
|
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("");
|
let id_str = input.split('\t').next().unwrap_or("");
|
||||||
id_str.parse().map_err(|_| "invalid id")
|
id_str.parse().map_err(|_| "invalid id")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ struct WlPasteArgs {
|
||||||
watch: Option<Vec<String>>,
|
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 {
|
match mime_arg {
|
||||||
None | Some("text" | "autodetect") => PasteMimeType::Text,
|
None | Some("text" | "autodetect") => PasteMimeType::Text,
|
||||||
Some(other) => PasteMimeType::Specific(other),
|
Some(other) => PasteMimeType::Specific(other),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue