treewide: format with rustfmt

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a69642c2865f41a4b141ddf39a198a3fc2e09
This commit is contained in:
raf 2025-08-20 09:40:20 +03:00
commit 6a5cd9b95d
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
10 changed files with 1191 additions and 1132 deletions

View file

@ -1,32 +1,32 @@
use crate::db::{ClipboardDb, SqliteClipboardDb};
use std::io::Read;
use crate::db::{ClipboardDb, SqliteClipboardDb};
pub trait StoreCommand {
fn store(
&self,
input: impl Read,
max_dedupe_search: u64,
max_items: u64,
state: Option<String>,
) -> Result<(), crate::db::StashError>;
fn store(
&self,
input: impl Read,
max_dedupe_search: u64,
max_items: u64,
state: Option<String>,
) -> Result<(), crate::db::StashError>;
}
impl StoreCommand for SqliteClipboardDb {
fn store(
&self,
input: impl Read,
max_dedupe_search: u64,
max_items: u64,
state: Option<String>,
) -> Result<(), crate::db::StashError> {
if let Some("sensitive" | "clear") = state.as_deref() {
self.delete_last()?;
log::info!("Entry deleted");
} else {
self.store_entry(input, max_dedupe_search, max_items)?;
log::info!("Entry stored");
}
Ok(())
fn store(
&self,
input: impl Read,
max_dedupe_search: u64,
max_items: u64,
state: Option<String>,
) -> Result<(), crate::db::StashError> {
if let Some("sensitive" | "clear") = state.as_deref() {
self.delete_last()?;
log::info!("Entry deleted");
} else {
self.store_entry(input, max_dedupe_search, max_items)?;
log::info!("Entry stored");
}
Ok(())
}
}