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/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() }