mirror of
https://github.com/NotAShelf/stash.git
synced 2026-04-13 14:33:47 +00:00
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I6a6a69648f81d0d094e11a3e0f0a19d3b8eccd5d
22 lines
605 B
Rust
22 lines
605 B
Rust
use crate::db::{ClipboardDb, SqliteClipboardDb, StashError};
|
|
|
|
use std::io::Read;
|
|
|
|
pub trait DeleteCommand {
|
|
fn delete(&self, input: impl Read) -> Result<usize, StashError>;
|
|
}
|
|
|
|
impl DeleteCommand for SqliteClipboardDb {
|
|
fn delete(&self, input: impl Read) -> Result<usize, StashError> {
|
|
match self.delete_entries(input) {
|
|
Ok(deleted) => {
|
|
log::info!("Deleted {deleted} entries");
|
|
Ok(deleted)
|
|
}
|
|
Err(e) => {
|
|
log::error!("Failed to delete entries: {e}");
|
|
Err(e)
|
|
}
|
|
}
|
|
}
|
|
}
|