mirror of
https://github.com/NotAShelf/stash.git
synced 2026-06-24 21:44:42 +00:00
treewide: improve logging; custom error types with thiserror
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I6a6a696464e4123d15cfaedf4727776e55948369
This commit is contained in:
parent
7dd3db4c88
commit
6e21021306
10 changed files with 221 additions and 166 deletions
|
|
@ -1,12 +1,13 @@
|
|||
use crate::db::{ClipboardDb, SledClipboardDb};
|
||||
|
||||
use crate::db::StashError;
|
||||
|
||||
pub trait QueryCommand {
|
||||
fn query_delete(&self, query: &str);
|
||||
fn query_delete(&self, query: &str) -> Result<usize, StashError>;
|
||||
}
|
||||
|
||||
impl QueryCommand for SledClipboardDb {
|
||||
fn query_delete(&self, query: &str) {
|
||||
<SledClipboardDb as ClipboardDb>::delete_query(self, query);
|
||||
log::info!("Entries matching query '{}' deleted", query);
|
||||
fn query_delete(&self, query: &str) -> Result<usize, StashError> {
|
||||
<SledClipboardDb as ClipboardDb>::delete_query(self, query)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue