treewide: improve logging; get rid of unwrap()s

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a696442ff25c3f65bb2d5f68e0d78a569fd76
This commit is contained in:
raf 2025-08-12 14:40:53 +03:00
commit 254c288111
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
11 changed files with 324 additions and 69 deletions

View file

@ -1,4 +1,5 @@
use crate::db::{ClipboardDb, SledClipboardDb};
use std::io::Read;
pub trait StoreCommand {
@ -19,13 +20,12 @@ impl StoreCommand for SledClipboardDb {
max_items: u64,
state: Option<String>,
) {
match state.as_deref() {
Some("sensitive") | Some("clear") => {
self.delete_last();
}
_ => {
self.store_entry(input, max_dedupe_search, max_items);
}
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");
}
}
}