From 9165298e28c0dcca559f160b1a6ce464744cb9d8 Mon Sep 17 00:00:00 2001 From: bot_apk Date: Mon, 16 Mar 2026 00:15:15 +0000 Subject: [PATCH 1/2] fix: apply cargo clippy fixes - Auto-fixed: simplify closures, remove unnecessary clones, use map_or - Manual fix: collapse nested if-let in recorder.rs sync_dir - Manual fix: remove unused import tauri::Manager in desktop lib.rs - Add plugins/cli2 to workspace exclude (no Cargo.toml, JS-only plugin) Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- Cargo.toml | 1 + apps/desktop/src-tauri/src/lib.rs | 1 - crates/analytics/src/posthog.rs | 2 +- crates/tiptap/src/from_ast.rs | 8 +++----- .../v1_0_2_nightly_14_extract_from_sqlite.rs | 7 +++---- .../fs-db/src/migrations/v1_0_2_nightly_1_from_v0.rs | 7 +++---- plugins/fs-db/src/version/macro.rs | 11 ++++------- plugins/listener/src/actors/recorder.rs | 8 ++++---- 8 files changed, 19 insertions(+), 26 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index fa5a7b3730..8b654a0a24 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,6 +30,7 @@ exclude = [ "apps/api", "apps/bot", "apps/web", + "plugins/cli2", "plugins/db", "plugins/export", ] diff --git a/apps/desktop/src-tauri/src/lib.rs b/apps/desktop/src-tauri/src/lib.rs index 76a0c104f7..2b13faf0c4 100644 --- a/apps/desktop/src-tauri/src/lib.rs +++ b/apps/desktop/src-tauri/src/lib.rs @@ -8,7 +8,6 @@ mod supervisor; use ext::*; use store::*; -use tauri::Manager; use tauri_plugin_permissions::{Permission, PermissionsPluginExt}; use tauri_plugin_windows::{AppWindow, WindowsPluginExt}; diff --git a/crates/analytics/src/posthog.rs b/crates/analytics/src/posthog.rs index 090c237a10..8dfa43b212 100644 --- a/crates/analytics/src/posthog.rs +++ b/crates/analytics/src/posthog.rs @@ -42,7 +42,7 @@ impl PosthogClient { distinct_id: &str, payload: &PropertiesPayload, ) -> Result<(), Error> { - let mut e = Event::new("$set", &distinct_id.to_string()); + let mut e = Event::new("$set", distinct_id); e.set_timestamp(chrono::Utc::now().naive_utc()); if !payload.set.is_empty() { diff --git a/crates/tiptap/src/from_ast.rs b/crates/tiptap/src/from_ast.rs index 18dc9e6c0f..029b794e86 100644 --- a/crates/tiptap/src/from_ast.rs +++ b/crates/tiptap/src/from_ast.rs @@ -21,15 +21,13 @@ fn unescape_markdown(md: &str) -> String { let mut chars = md.chars().peekable(); while let Some(c) = chars.next() { - if c == '\\' { - if let Some(&next) = chars.peek() { - if is_markdown_escapable(next) { + if c == '\\' + && let Some(&next) = chars.peek() + && is_markdown_escapable(next) { result.push(next); chars.next(); continue; } - } - } result.push(c); } diff --git a/plugins/fs-db/src/migrations/v1_0_2_nightly_14_extract_from_sqlite.rs b/plugins/fs-db/src/migrations/v1_0_2_nightly_14_extract_from_sqlite.rs index f5b286e11a..3df7083f9c 100644 --- a/plugins/fs-db/src/migrations/v1_0_2_nightly_14_extract_from_sqlite.rs +++ b/plugins/fs-db/src/migrations/v1_0_2_nightly_14_extract_from_sqlite.rs @@ -37,7 +37,7 @@ fn sanitize_filename(name: &str) -> String { .to_string() } -fn group_by_session_id<'a, T, F>(items: &'a [T], get_id: F) -> HashMap<&'a str, Vec<&'a T>> +fn group_by_session_id(items: &[T], get_id: F) -> HashMap<&str, Vec<&T>> where F: Fn(&T) -> &str, { @@ -138,14 +138,13 @@ fn collect_session_ops(base_dir: &Path, data: &Collection) -> Result }); // transcript.json (if exists) - if let Some(transcripts) = transcripts.get(sid) { - if let Some(t) = transcripts.first() { + if let Some(transcripts) = transcripts.get(sid) + && let Some(t) = transcripts.first() { ops.push(FileOp::Write { path: dir.join(files::TRANSCRIPT), content: build_transcript_json(t), }); } - } // _memo.md (if user has notes) ops.extend(build_memo_op(&dir, session)); diff --git a/plugins/fs-db/src/migrations/v1_0_2_nightly_1_from_v0.rs b/plugins/fs-db/src/migrations/v1_0_2_nightly_1_from_v0.rs index 9465ab5ea1..32fcd1f42f 100644 --- a/plugins/fs-db/src/migrations/v1_0_2_nightly_1_from_v0.rs +++ b/plugins/fs-db/src/migrations/v1_0_2_nightly_1_from_v0.rs @@ -32,7 +32,7 @@ fn sanitize_filename(name: &str) -> String { .to_string() } -fn group_by_session_id<'a, T, F>(items: &'a [T], get_id: F) -> HashMap<&'a str, Vec<&'a T>> +fn group_by_session_id(items: &[T], get_id: F) -> HashMap<&str, Vec<&T>> where F: Fn(&T) -> &str, { @@ -135,14 +135,13 @@ fn collect_session_ops(base_dir: &Path, data: &Collection) -> Result content: build_meta_json(session, session_participants, &session_tags), }); - if let Some(transcripts) = transcripts.get(sid) { - if let Some(t) = transcripts.first() { + if let Some(transcripts) = transcripts.get(sid) + && let Some(t) = transcripts.first() { ops.push(FileOp::Write { path: dir.join(files::TRANSCRIPT), content: build_transcript_json(t), }); } - } ops.extend(build_memo_op(&dir, session)); diff --git a/plugins/fs-db/src/version/macro.rs b/plugins/fs-db/src/version/macro.rs index 54e8169ad3..f9fbc12f24 100644 --- a/plugins/fs-db/src/version/macro.rs +++ b/plugins/fs-db/src/version/macro.rs @@ -24,15 +24,12 @@ pub fn parse(name: &str) -> Version { let mut version_str = format!("{major}.{minor}.{patch}"); - if let Some(&tag) = parts.get(3) { - if PRERELEASE_TAGS.contains(&tag) { - if let Some(&num) = parts.get(4) { - if num.chars().all(|c| c.is_ascii_digit()) { + if let Some(&tag) = parts.get(3) + && PRERELEASE_TAGS.contains(&tag) + && let Some(&num) = parts.get(4) + && num.chars().all(|c| c.is_ascii_digit()) { version_str.push_str(&format!("-{tag}.{num}")); } - } - } - } version_str.parse().unwrap() } diff --git a/plugins/listener/src/actors/recorder.rs b/plugins/listener/src/actors/recorder.rs index 7e0f30ad22..259333051a 100644 --- a/plugins/listener/src/actors/recorder.rs +++ b/plugins/listener/src/actors/recorder.rs @@ -275,9 +275,9 @@ fn sync_file(path: &std::path::Path) { } fn sync_dir(path: &std::path::Path) { - if let Some(parent) = path.parent() { - if let Ok(dir) = File::open(parent) { - let _ = dir.sync_all(); - } + if let Some(parent) = path.parent() + && let Ok(dir) = File::open(parent) + { + let _ = dir.sync_all(); } } From 93ccfc856ace1308549bc78ab32eb23dc944f906 Mon Sep 17 00:00:00 2001 From: bot_apk Date: Mon, 16 Mar 2026 00:28:51 +0000 Subject: [PATCH 2/2] fix: restore use tauri::Manager import needed for macOS-gated code Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- apps/desktop/src-tauri/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/desktop/src-tauri/src/lib.rs b/apps/desktop/src-tauri/src/lib.rs index 62fa892465..28612c6bd8 100644 --- a/apps/desktop/src-tauri/src/lib.rs +++ b/apps/desktop/src-tauri/src/lib.rs @@ -8,6 +8,7 @@ mod supervisor; use ext::*; use store::*; +use tauri::Manager; use tauri_plugin_permissions::{Permission, PermissionsPluginExt}; use tauri_plugin_windows::{AppWindow, WindowsPluginExt};