Refactor: Fix clippy warnings and introduce AppError

This commit is contained in:
Riz Ashraf committed 2026-09-30 20:43:28 +01:00
1 parent 3add6c3d31
commit 4e1a633dbd
13 files changed
+129 -103

No files matched your search

+3 -5
View File
@@ -19,9 +19,9 @@ pub fn spawn_watcher(state: Arc<MemoryState>) {
continue;
}
if let Ok(_clip) = tokio::task::spawn_blocking(|| Clipboard::new_attempts(3)).await.unwrap() {
if let Ok(text) = get_clipboard::<String, _>(formats::Unicode) {
if text != last_text && !text.trim().is_empty() {
if let Ok(_clip) = tokio::task::spawn_blocking(|| Clipboard::new_attempts(3)).await.unwrap()
&& let Ok(text) = get_clipboard::<String, _>(formats::Unicode)
&& text != last_text && !text.trim().is_empty() {
last_text = text.clone();
let note = StickyNote {
@@ -40,8 +40,6 @@ pub fn spawn_watcher(state: Arc<MemoryState>) {
// We use rebuild_index to index the new sticky note
state.rebuild_index().await;
}
}
}
}
});
}