chore(lint): clean up clippy warnings across workspace

Auto-applied cargo clippy --fix across 11 files — needless return,
unnecessary cast, map_or simplification, repeat().take() → repeat_n(),
iter().any() → contains(), manual char comparison, lifetime elision,
push_str single-char, reference immediately dereferenced.

Also fixed three lints on file_storage.rs manually: two doc-list-item
overindentations, plus the same needless-return. Baseline main was
not clippy-clean with -D warnings before; after this pass one
needless_range_loop warning remains (live.rs:1089) that clippy's
suggested rewrite would make less readable — left for a dedicated
refactor session.

Build + workspace tests remain green (245 passing, 0 failing, 1
ignored).
This commit is contained in:
2026-04-24 09:43:56 +01:00
parent 9b0067b4c0
commit fe61661305
11 changed files with 20 additions and 22 deletions

View File

@@ -247,7 +247,7 @@ pub async fn generate_diagnostic_report(
.map(|d| d.as_secs())
.unwrap_or(0);
out.push_str(&format!("- Generated: unix `{}`\n", now));
out.push_str("\n");
out.push('\n');
out.push_str(
"> This report is local-only until you choose to share it. \
Review the contents below before sending to anyone.\n\n",

View File

@@ -1155,12 +1155,10 @@ fn longest_common_token_subsequence(a: &[&str], b: &[&str]) -> usize {
}
fn is_low_signal_token(token: &str) -> bool {
LOW_SIGNAL_TOKENS
.iter()
.any(|low_signal| *low_signal == token)
LOW_SIGNAL_TOKENS.contains(&token)
}
fn meaningful_tokens<'a>(text: &'a str) -> Vec<&'a str> {
fn meaningful_tokens(text: &str) -> Vec<&str> {
text.split_whitespace()
.filter(|token| !token.is_empty() && token.len() > 1 && !is_low_signal_token(token))
.collect()

View File

@@ -412,7 +412,7 @@ pub fn detect_active_compute_device() -> ActiveComputeDevice {
reason: None,
};
}
return ActiveComputeDevice {
ActiveComputeDevice {
kind: "cpu".into(),
label: "CPU (fallback)".into(),
reason: Some(
@@ -420,7 +420,7 @@ pub fn detect_active_compute_device() -> ActiveComputeDevice {
libvulkan1 (Linux) to enable GPU acceleration."
.into(),
),
};
}
}
}

View File

@@ -345,7 +345,7 @@ fn classify_terminal(raw: &str) -> Option<String> {
fn detect_focused_window_class() -> Option<String> {
#[cfg(target_os = "linux")]
{
return detect_focused_window_class_linux();
detect_focused_window_class_linux()
}
#[cfg(target_os = "macos")]
{