From 5c4c2f6d92e7eac5195b333dc55d0f11a61bcf07 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 18 Mar 2026 00:23:26 +0000 Subject: [PATCH 1/8] fix: apply cargo clippy suggestions - Collapse nested if-let chains into combined let-chains (transcript segments) - Remove unnecessary clones and borrows (owhisper-client, transcript) - Add plugins/apple-contact and plugins/pdf to workspace exclude list (directories only contain node_modules with no Cargo.toml) Co-Authored-By: bot_apk --- Cargo.toml | 2 ++ .../src/adapter/cactus/batch.rs | 5 ++--- .../src/adapter/soniox/live.rs | 6 ++--- crates/transcript/src/label.rs | 5 ++--- crates/transcript/src/segments/collect.rs | 5 ++--- crates/transcript/src/segments/speakers.rs | 22 +++++++------------ 6 files changed, 19 insertions(+), 26 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b9f57353cc..ef8930f02f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,9 +18,11 @@ members = [ ] exclude = [ "plugins/apple-calendar", + "plugins/apple-contact", "plugins/cli2", "plugins/db", "plugins/extensions", + "plugins/pdf", "crates/vad-ext", ] diff --git a/crates/owhisper-client/src/adapter/cactus/batch.rs b/crates/owhisper-client/src/adapter/cactus/batch.rs index eb2bc25916..5fa4ad7588 100644 --- a/crates/owhisper-client/src/adapter/cactus/batch.rs +++ b/crates/owhisper-client/src/adapter/cactus/batch.rs @@ -310,15 +310,14 @@ impl SseParserState { &mut self, response: StreamResponse, ) -> Option> { - if let StreamResponse::TranscriptResponse { channel, .. } = &response { - if channel + if let StreamResponse::TranscriptResponse { channel, .. } = &response + && channel .alternatives .first() .is_some_and(|a| !a.words.is_empty()) { self.saw_segment_words = true; } - } let segment_end = match &response { StreamResponse::TranscriptResponse { diff --git a/crates/owhisper-client/src/adapter/soniox/live.rs b/crates/owhisper-client/src/adapter/soniox/live.rs index eef52d7895..ce3d4bcc7d 100644 --- a/crates/owhisper-client/src/adapter/soniox/live.rs +++ b/crates/owhisper-client/src/adapter/soniox/live.rs @@ -293,9 +293,9 @@ fn build_words(tokens: &[&soniox::Token]) -> Vec( - tokens: &'a [soniox::Token], -) -> (Vec<&'a soniox::Token>, Vec<&'a soniox::Token>) { +fn partition_tokens_by_word_finality( + tokens: &[soniox::Token], +) -> (Vec<&soniox::Token>, Vec<&soniox::Token>) { let mut final_tokens = Vec::new(); let mut non_final_tokens = Vec::new(); for group in token_groups_from_values(tokens) { diff --git a/crates/transcript/src/label.rs b/crates/transcript/src/label.rs index bf18f53c5d..8c29ee2fd5 100644 --- a/crates/transcript/src/label.rs +++ b/crates/transcript/src/label.rs @@ -77,14 +77,13 @@ pub fn render_speaker_label( return human_id.clone(); } - if key.channel == ChannelProfile::DirectMic { - if let Some(self_human_id) = ctx.self_human_id.as_ref() { + if key.channel == ChannelProfile::DirectMic + && let Some(self_human_id) = ctx.self_human_id.as_ref() { if let Some(name) = ctx.human_name_by_id.get(self_human_id) { return name.clone(); } return "You".to_string(); } - } } else if let Some(human_id) = key.speaker_human_id.as_ref() { return human_id.clone(); } diff --git a/crates/transcript/src/segments/collect.rs b/crates/transcript/src/segments/collect.rs index 69c0ae50e6..c0f9fcbbbb 100644 --- a/crates/transcript/src/segments/collect.rs +++ b/crates/transcript/src/segments/collect.rs @@ -95,11 +95,10 @@ fn determine_key( segments: &[ProtoSegment], last_segment_by_channel: &HashMap, ) -> SegmentKey { - if !frame.word.is_final { - if let Some(&index) = last_segment_by_channel.get(&frame.word.channel) { + if !frame.word.is_final + && let Some(&index) = last_segment_by_channel.get(&frame.word.channel) { return segments[index].key.clone(); } - } create_segment_key(frame.word.channel, frame.identity.as_ref()) } diff --git a/crates/transcript/src/segments/speakers.rs b/crates/transcript/src/segments/speakers.rs index bd1bd3a6e9..86dba207d6 100644 --- a/crates/transcript/src/segments/speakers.rs +++ b/crates/transcript/src/segments/speakers.rs @@ -118,22 +118,19 @@ fn apply_identity_rules( ) -> SpeakerIdentity { let mut identity = assignment.cloned().unwrap_or_default(); - if identity.speaker_index.is_some() && identity.human_id.is_none() { - if let Some(speaker_index) = identity.speaker_index { - if let Some(human_id) = state.human_id_by_speaker_index.get(&speaker_index) { + if identity.speaker_index.is_some() && identity.human_id.is_none() + && let Some(speaker_index) = identity.speaker_index + && let Some(human_id) = state.human_id_by_speaker_index.get(&speaker_index) { identity.human_id = Some(human_id.clone()); } - } - } - if identity.human_id.is_none() && state.complete_channels.contains(&word.channel) { - if let Some(human_id) = state.human_id_by_channel.get(&word.channel) { + if identity.human_id.is_none() && state.complete_channels.contains(&word.channel) + && let Some(human_id) = state.human_id_by_channel.get(&word.channel) { identity.human_id = Some(human_id.clone()); } - } - if !word.is_final && !(identity.speaker_index.is_some() && identity.human_id.is_some()) { - if let Some(last) = state.last_speaker_by_channel.get(&word.channel) { + if !word.is_final && !(identity.speaker_index.is_some() && identity.human_id.is_some()) + && let Some(last) = state.last_speaker_by_channel.get(&word.channel) { if identity.speaker_index.is_none() { identity.speaker_index = last.speaker_index; } @@ -141,7 +138,6 @@ fn apply_identity_rules( identity.human_id = last.human_id.clone(); } } - } identity } @@ -165,11 +161,9 @@ fn remember_identity( if state.complete_channels.contains(&word.channel) && identity.human_id.is_some() && identity.speaker_index.is_none() - { - if let Some(human_id) = identity.human_id.clone() { + && let Some(human_id) = identity.human_id.clone() { state.human_id_by_channel.insert(word.channel, human_id); } - } if (!word.is_final || identity.speaker_index.is_some() || has_explicit_assignment) && !identity.is_empty() From 3b870881115e09510b946c1ba6ea9e55093a4241 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 18 Mar 2026 00:37:02 +0000 Subject: [PATCH 2/8] fix: apply rustfmt formatting to clippy-fixed files Co-Authored-By: bot_apk --- .../src/adapter/cactus/batch.rs | 6 +-- crates/transcript/src/label.rs | 11 ++--- crates/transcript/src/segments/collect.rs | 7 +-- crates/transcript/src/segments/speakers.rs | 45 +++++++++++-------- 4 files changed, 39 insertions(+), 30 deletions(-) diff --git a/crates/owhisper-client/src/adapter/cactus/batch.rs b/crates/owhisper-client/src/adapter/cactus/batch.rs index 5fa4ad7588..659f291349 100644 --- a/crates/owhisper-client/src/adapter/cactus/batch.rs +++ b/crates/owhisper-client/src/adapter/cactus/batch.rs @@ -315,9 +315,9 @@ impl SseParserState { .alternatives .first() .is_some_and(|a| !a.words.is_empty()) - { - self.saw_segment_words = true; - } + { + self.saw_segment_words = true; + } let segment_end = match &response { StreamResponse::TranscriptResponse { diff --git a/crates/transcript/src/label.rs b/crates/transcript/src/label.rs index 8c29ee2fd5..7cfdb8ea52 100644 --- a/crates/transcript/src/label.rs +++ b/crates/transcript/src/label.rs @@ -78,12 +78,13 @@ pub fn render_speaker_label( } if key.channel == ChannelProfile::DirectMic - && let Some(self_human_id) = ctx.self_human_id.as_ref() { - if let Some(name) = ctx.human_name_by_id.get(self_human_id) { - return name.clone(); - } - return "You".to_string(); + && let Some(self_human_id) = ctx.self_human_id.as_ref() + { + if let Some(name) = ctx.human_name_by_id.get(self_human_id) { + return name.clone(); } + return "You".to_string(); + } } else if let Some(human_id) = key.speaker_human_id.as_ref() { return human_id.clone(); } diff --git a/crates/transcript/src/segments/collect.rs b/crates/transcript/src/segments/collect.rs index c0f9fcbbbb..fb76532267 100644 --- a/crates/transcript/src/segments/collect.rs +++ b/crates/transcript/src/segments/collect.rs @@ -96,9 +96,10 @@ fn determine_key( last_segment_by_channel: &HashMap, ) -> SegmentKey { if !frame.word.is_final - && let Some(&index) = last_segment_by_channel.get(&frame.word.channel) { - return segments[index].key.clone(); - } + && let Some(&index) = last_segment_by_channel.get(&frame.word.channel) + { + return segments[index].key.clone(); + } create_segment_key(frame.word.channel, frame.identity.as_ref()) } diff --git a/crates/transcript/src/segments/speakers.rs b/crates/transcript/src/segments/speakers.rs index 86dba207d6..b4a72a274a 100644 --- a/crates/transcript/src/segments/speakers.rs +++ b/crates/transcript/src/segments/speakers.rs @@ -118,26 +118,32 @@ fn apply_identity_rules( ) -> SpeakerIdentity { let mut identity = assignment.cloned().unwrap_or_default(); - if identity.speaker_index.is_some() && identity.human_id.is_none() + if identity.speaker_index.is_some() + && identity.human_id.is_none() && let Some(speaker_index) = identity.speaker_index - && let Some(human_id) = state.human_id_by_speaker_index.get(&speaker_index) { - identity.human_id = Some(human_id.clone()); - } + && let Some(human_id) = state.human_id_by_speaker_index.get(&speaker_index) + { + identity.human_id = Some(human_id.clone()); + } - if identity.human_id.is_none() && state.complete_channels.contains(&word.channel) - && let Some(human_id) = state.human_id_by_channel.get(&word.channel) { - identity.human_id = Some(human_id.clone()); - } + if identity.human_id.is_none() + && state.complete_channels.contains(&word.channel) + && let Some(human_id) = state.human_id_by_channel.get(&word.channel) + { + identity.human_id = Some(human_id.clone()); + } - if !word.is_final && !(identity.speaker_index.is_some() && identity.human_id.is_some()) - && let Some(last) = state.last_speaker_by_channel.get(&word.channel) { - if identity.speaker_index.is_none() { - identity.speaker_index = last.speaker_index; - } - if identity.human_id.is_none() { - identity.human_id = last.human_id.clone(); - } + if !word.is_final + && !(identity.speaker_index.is_some() && identity.human_id.is_some()) + && let Some(last) = state.last_speaker_by_channel.get(&word.channel) + { + if identity.speaker_index.is_none() { + identity.speaker_index = last.speaker_index; } + if identity.human_id.is_none() { + identity.human_id = last.human_id.clone(); + } + } identity } @@ -161,9 +167,10 @@ fn remember_identity( if state.complete_channels.contains(&word.channel) && identity.human_id.is_some() && identity.speaker_index.is_none() - && let Some(human_id) = identity.human_id.clone() { - state.human_id_by_channel.insert(word.channel, human_id); - } + && let Some(human_id) = identity.human_id.clone() + { + state.human_id_by_channel.insert(word.channel, human_id); + } if (!word.is_final || identity.speaker_index.is_some() || has_explicit_assignment) && !identity.is_empty() From 3e8406fc05cf6f95e78da5ba4bf19ea4bcfe83fa Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 18 Mar 2026 00:50:05 +0000 Subject: [PATCH 3/8] fix: address clippy too_many_arguments and nonminimal_bool warnings Co-Authored-By: bot_apk --- crates/cactus/src/stt/stream.rs | 1 + crates/transcript/src/segments/speakers.rs | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/cactus/src/stt/stream.rs b/crates/cactus/src/stt/stream.rs index 86a4ab6a5e..8d46154d1a 100644 --- a/crates/cactus/src/stt/stream.rs +++ b/crates/cactus/src/stt/stream.rs @@ -113,6 +113,7 @@ pub fn transcribe_stream( } } +#[allow(clippy::too_many_arguments)] fn run_transcribe_worker( model: Arc, options: TranscribeOptions, diff --git a/crates/transcript/src/segments/speakers.rs b/crates/transcript/src/segments/speakers.rs index b4a72a274a..86b2bcf230 100644 --- a/crates/transcript/src/segments/speakers.rs +++ b/crates/transcript/src/segments/speakers.rs @@ -133,8 +133,7 @@ fn apply_identity_rules( identity.human_id = Some(human_id.clone()); } - if !word.is_final - && !(identity.speaker_index.is_some() && identity.human_id.is_some()) + if !(word.is_final || identity.speaker_index.is_some() && identity.human_id.is_some()) && let Some(last) = state.last_speaker_by_channel.get(&word.channel) { if identity.speaker_index.is_none() { From a9efa75409c4d5a4e72212cb0531f37a75ce09bc Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 18 Mar 2026 01:07:42 +0000 Subject: [PATCH 4/8] fix: address macOS-only clippy warnings (collapsible_if, too_many_arguments, needless_range_loop) Co-Authored-By: bot_apk --- crates/device-monitor/src/macos.rs | 20 +++++++++---------- .../src/service/batch/transcribe.rs | 1 + .../src/service/streaming/debug.rs | 1 + .../src/service/streaming/response.rs | 1 + .../src/service/streaming/session.rs | 3 +-- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/crates/device-monitor/src/macos.rs b/crates/device-monitor/src/macos.rs index 3992ba7f24..04ea7d766a 100644 --- a/crates/device-monitor/src/macos.rs +++ b/crates/device-monitor/src/macos.rs @@ -262,16 +262,16 @@ fn handle_volume_mute_event(sender: &S, addr: &ca::PropAddr) { addr.element, ); } - } else if addr.scope == ca::PropScope::INPUT { - if let Ok(device) = ca::System::default_input_device() { - send_mute_update( - sender, - &device, - ca::PropSelector::DEVICE_MUTE, - ca::PropScope::INPUT, - addr.element, - ); - } + } else if addr.scope == ca::PropScope::INPUT + && let Ok(device) = ca::System::default_input_device() + { + send_mute_update( + sender, + &device, + ca::PropSelector::DEVICE_MUTE, + ca::PropScope::INPUT, + addr.element, + ); } } _ => {} diff --git a/crates/transcribe-cactus/src/service/batch/transcribe.rs b/crates/transcribe-cactus/src/service/batch/transcribe.rs index 0118b10fda..4fbc9badab 100644 --- a/crates/transcribe-cactus/src/service/batch/transcribe.rs +++ b/crates/transcribe-cactus/src/service/batch/transcribe.rs @@ -157,6 +157,7 @@ fn chunk_channel_audio( } } +#[allow(clippy::too_many_arguments)] fn transcribe_chunks( channel_idx: usize, chunks: &[hypr_vad_chunking::AudioChunk], diff --git a/crates/transcribe-cactus/src/service/streaming/debug.rs b/crates/transcribe-cactus/src/service/streaming/debug.rs index 919234a475..42117cb138 100644 --- a/crates/transcribe-cactus/src/service/streaming/debug.rs +++ b/crates/transcribe-cactus/src/service/streaming/debug.rs @@ -49,6 +49,7 @@ impl std::fmt::Display for Event<'_> { } } +#[allow(clippy::too_many_arguments)] pub(super) fn log( ch: usize, audio_offset: f64, diff --git a/crates/transcribe-cactus/src/service/streaming/response.rs b/crates/transcribe-cactus/src/service/streaming/response.rs index 5be46dbb3e..d1fddb98f1 100644 --- a/crates/transcribe-cactus/src/service/streaming/response.rs +++ b/crates/transcribe-cactus/src/service/streaming/response.rs @@ -36,6 +36,7 @@ pub(super) fn build_session_metadata(model_path: &Path) -> Metadata { crate::service::build_metadata(model_path) } +#[allow(clippy::too_many_arguments)] pub(super) fn build_transcript_response( text: &str, start: f64, diff --git a/crates/transcribe-cactus/src/service/streaming/session.rs b/crates/transcribe-cactus/src/service/streaming/session.rs index 809a225228..e4ecce921c 100644 --- a/crates/transcribe-cactus/src/service/streaming/session.rs +++ b/crates/transcribe-cactus/src/service/streaming/session.rs @@ -561,9 +561,8 @@ async fn handle_finalize( total_channels: usize, metadata: &Metadata, ) -> bool { - for ch_idx in 0..total_channels { + for (ch_idx, state) in channel_states.iter().enumerate().take(total_channels) { let (pending_text, pending_confidence, pending_language, segment_start, audio_offset) = { - let state = &channel_states[ch_idx]; ( state.pending_text.trim().to_string(), state.pending_confidence, From c69174d9c8ec3371b1ddfaefd136342cd621eca4 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 18 Mar 2026 01:24:38 +0000 Subject: [PATCH 5/8] fix: address needless_range_loop in audio-actual rt_ring Co-Authored-By: bot_apk --- crates/audio-actual/src/rt_ring.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/audio-actual/src/rt_ring.rs b/crates/audio-actual/src/rt_ring.rs index 84d93aedf5..df38d61417 100644 --- a/crates/audio-actual/src/rt_ring.rs +++ b/crates/audio-actual/src/rt_ring.rs @@ -48,8 +48,8 @@ where let convert_count = count.min(vacant); - for i in 0..convert_count { - scratch[i] = data[offset + i].to_sample_(); + for (i, slot) in scratch.iter_mut().enumerate().take(convert_count) { + *slot = data[offset + i].to_sample_(); } let pushed = producer.push_slice(&scratch[..convert_count]); @@ -76,8 +76,8 @@ where let convert_count = count.min(vacant); - for i in 0..convert_count { - scratch[i] = data[(offset + i) * channels].to_sample_(); + for (i, slot) in scratch.iter_mut().enumerate().take(convert_count) { + *slot = data[(offset + i) * channels].to_sample_(); } let pushed = producer.push_slice(&scratch[..convert_count]); @@ -126,8 +126,8 @@ where let convert_count = count.min(vacant); - for i in 0..convert_count { - scratch[i] = convert(samples[offset + i]); + for (i, slot) in scratch.iter_mut().enumerate().take(convert_count) { + *slot = convert(samples[offset + i]); } let pushed = producer.push_slice(&scratch[..convert_count]); @@ -197,9 +197,9 @@ where let convert_count = count.min(vacant); - for i in 0..convert_count { + for (i, slot) in scratch.iter_mut().enumerate().take(convert_count) { let byte_offset = (offset + i) * frame_size; - scratch[i] = f32::from_le_bytes([ + *slot = f32::from_le_bytes([ data[byte_offset], data[byte_offset + 1], data[byte_offset + 2], From 2da51f21257eb7e44994c95f3395289b74956e5f Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 18 Mar 2026 01:49:15 +0000 Subject: [PATCH 6/8] fix: address remaining macOS clippy warnings (dead_code, too_many_arguments, collapsible_if, large_enum_variant, needless_ok) Co-Authored-By: bot_apk --- crates/cli-editor/src/buffer.rs | 1 + crates/cli-editor/src/highlight.rs | 41 +++++++++---------- .../listener-core/src/actors/recorder/disk.rs | 1 + .../src/actors/recorder/memory/mod.rs | 3 ++ .../actors/recorder/memory/retained_audio.rs | 2 + .../listener-core/src/actors/recorder/mod.rs | 1 + .../src/actors/session/supervisor/children.rs | 2 +- crates/transcribe-proxy/src/relay/builder.rs | 1 + .../src/relay/channel_split/coordinator.rs | 7 ++-- .../src/relay/channel_split/io.rs | 10 ++--- .../src/relay/channel_split/payload.rs | 1 + crates/transcribe-proxy/src/relay/handler.rs | 15 ++++--- 12 files changed, 44 insertions(+), 41 deletions(-) diff --git a/crates/cli-editor/src/buffer.rs b/crates/cli-editor/src/buffer.rs index 653b0b8685..6b276a719e 100644 --- a/crates/cli-editor/src/buffer.rs +++ b/crates/cli-editor/src/buffer.rs @@ -146,6 +146,7 @@ impl Buffer { } } + #[allow(dead_code)] pub fn clear(&mut self) { self.lines.clear(); self.lines.push(String::new()); diff --git a/crates/cli-editor/src/highlight.rs b/crates/cli-editor/src/highlight.rs index 19ada7ac16..a166124145 100644 --- a/crates/cli-editor/src/highlight.rs +++ b/crates/cli-editor/src/highlight.rs @@ -218,13 +218,11 @@ impl Highlighter { styles[line_idx].push((local_start..local_end, style)); } // Record link info if inside a link - if let Some(url) = link_url_stack.last() { - if line_idx < links.len() { - links[line_idx].push(LinkInfo { - range: local_start..local_end, - url: url.clone(), - }); - } + if let Some(url) = link_url_stack.last() && line_idx < links.len() { + links[line_idx].push(LinkInfo { + range: local_start..local_end, + url: url.clone(), + }); } } } @@ -244,25 +242,24 @@ impl Highlighter { result: &mut [Vec<(Range, Style)>], lines: &[String], ) { - if let Some(lang) = lang { - if let Some(syntax) = SYNTAX_SET.find_syntax_by_token(lang) { - let theme = &THEME_SET.themes["base16-ocean.dark"]; - let mut h = HighlightLines::new(syntax, theme); - for (i, code_line) in LinesWithEndings::from(code).enumerate() { - let line_idx = start_line + i; - if line_idx >= result.len() { - break; - } - if let Ok(ranges) = h.highlight_line(code_line, &SYNTAX_SET) { - let escaped = as_24_bit_terminal_escaped(&ranges, false); - if let Ok(text) = escaped.into_text() { - apply_syntect_line(&text, line_idx, result, lines); - } + if let Some(lang) = lang && let Some(syntax) = SYNTAX_SET.find_syntax_by_token(lang) { + let theme = &THEME_SET.themes["base16-ocean.dark"]; + let mut h = HighlightLines::new(syntax, theme); + for (i, code_line) in LinesWithEndings::from(code).enumerate() { + let line_idx = start_line + i; + if line_idx >= result.len() { + break; + } + if let Ok(ranges) = h.highlight_line(code_line, &SYNTAX_SET) { + let escaped = as_24_bit_terminal_escaped(&ranges, false); + if let Ok(text) = escaped.into_text() { + apply_syntect_line(&text, line_idx, result, lines); } } - return; } + return; } + // Fallback: style code block content with code_fence style let style = self.styles.code_fence(); for (i, code_line) in code.lines().enumerate() { diff --git a/crates/listener-core/src/actors/recorder/disk.rs b/crates/listener-core/src/actors/recorder/disk.rs index ea96e40565..a1766ddf5c 100644 --- a/crates/listener-core/src/actors/recorder/disk.rs +++ b/crates/listener-core/src/actors/recorder/disk.rs @@ -34,6 +34,7 @@ pub(super) fn has_existing_audio(session_dir: &Path) -> bool { encoded_path.exists() || wav_path.exists() || ogg_path.exists() } +#[allow(dead_code)] pub(super) fn infer_existing_audio_channels( session_dir: &Path, ) -> Result, ActorProcessingErr> { diff --git a/crates/listener-core/src/actors/recorder/memory/mod.rs b/crates/listener-core/src/actors/recorder/memory/mod.rs index d5212291d0..624cd35d9d 100644 --- a/crates/listener-core/src/actors/recorder/memory/mod.rs +++ b/crates/listener-core/src/actors/recorder/memory/mod.rs @@ -10,6 +10,7 @@ use ractor::ActorProcessingErr; use super::{RecorderEncoder, disk}; use retained_audio::{MemoryRetentionPolicy, RetainedAudio}; +#[allow(dead_code)] const DEFAULT_MEMORY_RETENTION: MemoryRetentionPolicy = MemoryRetentionPolicy::KeepLast(Duration::from_secs(60 * 60)); @@ -19,10 +20,12 @@ pub(super) struct MemorySink { retained: RetainedAudio, } +#[allow(dead_code)] pub(super) fn create_memory_sink(session_dir: &Path) -> Result { create_memory_sink_with_retention(session_dir, DEFAULT_MEMORY_RETENTION) } +#[allow(dead_code)] fn create_memory_sink_with_retention( session_dir: &Path, retention: MemoryRetentionPolicy, diff --git a/crates/listener-core/src/actors/recorder/memory/retained_audio.rs b/crates/listener-core/src/actors/recorder/memory/retained_audio.rs index 10f51132fe..df8644e1d9 100644 --- a/crates/listener-core/src/actors/recorder/memory/retained_audio.rs +++ b/crates/listener-core/src/actors/recorder/memory/retained_audio.rs @@ -2,6 +2,7 @@ use std::collections::VecDeque; use std::time::Duration; #[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[allow(dead_code)] pub(super) enum MemoryRetentionPolicy { KeepLast(Duration), } @@ -20,6 +21,7 @@ pub(super) struct RetainedAudio { } impl RetainedAudio { + #[allow(dead_code)] pub(super) fn new(retention: MemoryRetentionPolicy) -> Self { Self { retention, diff --git a/crates/listener-core/src/actors/recorder/mod.rs b/crates/listener-core/src/actors/recorder/mod.rs index 4c6f9abcfb..20690cdc76 100644 --- a/crates/listener-core/src/actors/recorder/mod.rs +++ b/crates/listener-core/src/actors/recorder/mod.rs @@ -33,6 +33,7 @@ enum RecorderSink { Disabled, } +#[allow(dead_code)] enum RecorderEncoder { Mono(hypr_mp3::MonoStreamEncoder), Stereo(hypr_mp3::StereoStreamEncoder), diff --git a/crates/listener-core/src/actors/session/supervisor/children.rs b/crates/listener-core/src/actors/session/supervisor/children.rs index 5b28f390e3..9bac09eb3d 100644 --- a/crates/listener-core/src/actors/session/supervisor/children.rs +++ b/crates/listener-core/src/actors/session/supervisor/children.rs @@ -174,7 +174,7 @@ pub(super) async fn try_restart_recorder( let cell = spawn_with_retry(&RETRY_STRATEGY, || { let sup = sup.clone(); let ctx = ctx.clone(); - async move { Ok(spawn_recorder(sup, &ctx).await?) } + async move { spawn_recorder(sup, &ctx).await } }) .await; diff --git a/crates/transcribe-proxy/src/relay/builder.rs b/crates/transcribe-proxy/src/relay/builder.rs index f624e9d712..e84898361b 100644 --- a/crates/transcribe-proxy/src/relay/builder.rs +++ b/crates/transcribe-proxy/src/relay/builder.rs @@ -69,6 +69,7 @@ impl WebSocketProxyBuilder { } } + #[allow(clippy::too_many_arguments)] fn build_from( request: ClientRequestBuilder, control_message_types: HashSet<&'static str>, diff --git a/crates/transcribe-proxy/src/relay/channel_split/coordinator.rs b/crates/transcribe-proxy/src/relay/channel_split/coordinator.rs index e15c9061b6..84b0acc492 100644 --- a/crates/transcribe-proxy/src/relay/channel_split/coordinator.rs +++ b/crates/transcribe-proxy/src/relay/channel_split/coordinator.rs @@ -18,6 +18,7 @@ pub(super) enum SplitEvent { ClientClosed, } +#[allow(clippy::large_enum_variant)] pub(super) enum CoordinatorAction { ForwardText(String), ForwardRewritten(RewrittenSplitResponse), @@ -128,10 +129,8 @@ impl SplitCoordinator { return actions; } - if self.should_release_pending_finalize(channel) { - if let Some(generation) = self.flush_pending(&mut actions, FinalizeMode::Terminal) { - self.mark_terminal_finalize_sent(generation); - } + if self.should_release_pending_finalize(channel) && let Some(generation) = self.flush_pending(&mut actions, FinalizeMode::Terminal) { + self.mark_terminal_finalize_sent(generation); } if self.channels.iter().all(|channel| channel.closed) { diff --git a/crates/transcribe-proxy/src/relay/channel_split/io.rs b/crates/transcribe-proxy/src/relay/channel_split/io.rs index c0a8a9bcc3..d639c7fe46 100644 --- a/crates/transcribe-proxy/src/relay/channel_split/io.rs +++ b/crates/transcribe-proxy/src/relay/channel_split/io.rs @@ -83,12 +83,10 @@ pub(super) async fn relay_client_to_upstreams( tokio::select! { biased; result = shutdown_rx.recv() => { - if let Ok(signal) = result { - if let ShutdownSignal::Close { code, reason } = signal { - let close = convert::to_tungstenite_close(code, reason); - let _ = mic_tx.send(close.clone()).await; - let _ = spk_tx.send(close).await; - } + if let Ok(signal) = result && let ShutdownSignal::Close { code, reason } = signal { + let close = convert::to_tungstenite_close(code, reason); + let _ = mic_tx.send(close.clone()).await; + let _ = spk_tx.send(close).await; } break; }, diff --git a/crates/transcribe-proxy/src/relay/channel_split/payload.rs b/crates/transcribe-proxy/src/relay/channel_split/payload.rs index cfc054a093..d240d6616c 100644 --- a/crates/transcribe-proxy/src/relay/channel_split/payload.rs +++ b/crates/transcribe-proxy/src/relay/channel_split/payload.rs @@ -24,6 +24,7 @@ pub(super) enum FinalizeMode { Terminal, } +#[allow(clippy::large_enum_variant)] enum SplitPayload { Single(StreamResponse), Batch(Vec), diff --git a/crates/transcribe-proxy/src/relay/handler.rs b/crates/transcribe-proxy/src/relay/handler.rs index c0fb3249f9..75c6aeb27c 100644 --- a/crates/transcribe-proxy/src/relay/handler.rs +++ b/crates/transcribe-proxy/src/relay/handler.rs @@ -35,6 +35,7 @@ pub struct WebSocketProxy { } impl WebSocketProxy { + #[allow(clippy::too_many_arguments)] pub(crate) fn new( upstream_request: ClientRequestBuilder, control_message_types: Option, @@ -140,6 +141,7 @@ impl WebSocketProxy { .into_response() } + #[allow(clippy::too_many_arguments)] async fn run_proxy_loop( client_socket: WebSocket, upstream_stream: WebSocketStream>, @@ -246,6 +248,7 @@ impl WebSocketProxy { false } + #[allow(clippy::too_many_arguments)] async fn run_client_to_upstream( mut client_receiver: ClientReceiver, mut upstream_sender: UpstreamSender, @@ -275,10 +278,8 @@ impl WebSocketProxy { biased; result = shutdown_rx.recv() => { - if let Ok(signal) = result { - if let ShutdownSignal::Close { code, reason } = signal { - let _ = upstream_sender.send(convert::to_tungstenite_close(code, reason)).await; - } + if let Ok(signal) = result && let ShutdownSignal::Close { code, reason } = signal { + let _ = upstream_sender.send(convert::to_tungstenite_close(code, reason)).await; } break; } @@ -390,10 +391,8 @@ impl WebSocketProxy { biased; result = shutdown_rx.recv() => { - if let Ok(signal) = result { - if let ShutdownSignal::Close { code, reason } = signal { - let _ = client_sender.send(convert::to_axum_close(code, reason)).await; - } + if let Ok(signal) = result && let ShutdownSignal::Close { code, reason } = signal { + let _ = client_sender.send(convert::to_axum_close(code, reason)).await; } break; } From e256b35a183218969cea292c1178b0118348ab40 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 18 Mar 2026 02:07:13 +0000 Subject: [PATCH 7/8] fix: address cli-tui new_without_default, transcribe-proxy unnecessary_lazy_evaluations, and formatting Co-Authored-By: bot_apk --- crates/cli-editor/src/highlight.rs | 8 ++++++-- crates/cli-tui/src/terminal.rs | 6 ++++++ .../src/relay/channel_split/coordinator.rs | 4 +++- crates/transcribe-proxy/src/relay/channel_split/mod.rs | 2 +- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/crates/cli-editor/src/highlight.rs b/crates/cli-editor/src/highlight.rs index a166124145..cbf1aaeae5 100644 --- a/crates/cli-editor/src/highlight.rs +++ b/crates/cli-editor/src/highlight.rs @@ -218,7 +218,9 @@ impl Highlighter { styles[line_idx].push((local_start..local_end, style)); } // Record link info if inside a link - if let Some(url) = link_url_stack.last() && line_idx < links.len() { + if let Some(url) = link_url_stack.last() + && line_idx < links.len() + { links[line_idx].push(LinkInfo { range: local_start..local_end, url: url.clone(), @@ -242,7 +244,9 @@ impl Highlighter { result: &mut [Vec<(Range, Style)>], lines: &[String], ) { - if let Some(lang) = lang && let Some(syntax) = SYNTAX_SET.find_syntax_by_token(lang) { + if let Some(lang) = lang + && let Some(syntax) = SYNTAX_SET.find_syntax_by_token(lang) + { let theme = &THEME_SET.themes["base16-ocean.dark"]; let mut h = HighlightLines::new(syntax, theme); for (i, code_line) in LinesWithEndings::from(code).enumerate() { diff --git a/crates/cli-tui/src/terminal.rs b/crates/cli-tui/src/terminal.rs index 22f82e25e5..0f64f8f2b0 100644 --- a/crates/cli-tui/src/terminal.rs +++ b/crates/cli-tui/src/terminal.rs @@ -7,6 +7,12 @@ pub struct TerminalGuard { inline: bool, } +impl Default for TerminalGuard { + fn default() -> Self { + Self::new() + } +} + impl TerminalGuard { pub fn new() -> Self { install_panic_hook(); diff --git a/crates/transcribe-proxy/src/relay/channel_split/coordinator.rs b/crates/transcribe-proxy/src/relay/channel_split/coordinator.rs index 84b0acc492..df54064a4e 100644 --- a/crates/transcribe-proxy/src/relay/channel_split/coordinator.rs +++ b/crates/transcribe-proxy/src/relay/channel_split/coordinator.rs @@ -129,7 +129,9 @@ impl SplitCoordinator { return actions; } - if self.should_release_pending_finalize(channel) && let Some(generation) = self.flush_pending(&mut actions, FinalizeMode::Terminal) { + if self.should_release_pending_finalize(channel) + && let Some(generation) = self.flush_pending(&mut actions, FinalizeMode::Terminal) + { self.mark_terminal_finalize_sent(generation); } diff --git a/crates/transcribe-proxy/src/relay/channel_split/mod.rs b/crates/transcribe-proxy/src/relay/channel_split/mod.rs index 0766575147..45bb93cb6a 100644 --- a/crates/transcribe-proxy/src/relay/channel_split/mod.rs +++ b/crates/transcribe-proxy/src/relay/channel_split/mod.rs @@ -219,7 +219,7 @@ impl ChannelSplitProxy { if proxy_debug_enabled() { let rewritten_log = rewritten .as_ref() - .and_then(|_| transformed_log.as_deref()) + .and(transformed_log.as_deref()) .and_then(|text| { rewrite_split_response( text, From 2112f6953722f98ab6c4b7e466a416af225b22e7 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 18 Mar 2026 02:26:59 +0000 Subject: [PATCH 8/8] fix: address cli clippy errors (dead_code, collapsible_if, never_loop, derivable_impls, wrong_self_convention) Co-Authored-By: bot_apk --- apps/cli/src/commands/connect/app.rs | 5 +++-- apps/cli/src/commands/connect/mod.rs | 20 +++++++++---------- .../src/commands/entry/ui/command_input.rs | 7 +------ apps/cli/src/commands/listen/mod.rs | 16 +++++++-------- apps/cli/src/commands/sessions/app.rs | 8 ++++---- apps/cli/src/commands/sessions/mod.rs | 8 ++++---- apps/cli/src/config/stt.rs | 1 + apps/cli/src/theme.rs | 1 + 8 files changed, 30 insertions(+), 36 deletions(-) diff --git a/apps/cli/src/commands/connect/app.rs b/apps/cli/src/commands/connect/app.rs index 7233b5b03b..028d2bf895 100644 --- a/apps/cli/src/commands/connect/app.rs +++ b/apps/cli/src/commands/connect/app.rs @@ -281,8 +281,9 @@ impl App { } Step::SelectProvider => { if let Some(provider) = self.provider { - let ct = self.connection_type.unwrap(); - if provider.valid_for(ct) { + if let Some(ct) = self.connection_type + && provider.valid_for(ct) + { self.step = Step::InputBaseUrl; continue; } diff --git a/apps/cli/src/commands/connect/mod.rs b/apps/cli/src/commands/connect/mod.rs index ce616fcb48..9b85f76493 100644 --- a/apps/cli/src/commands/connect/mod.rs +++ b/apps/cli/src/commands/connect/mod.rs @@ -28,22 +28,20 @@ struct ConnectScreen { impl ConnectScreen { fn apply_effects(&mut self, effects: Vec) -> ScreenControl> { for effect in effects { - match effect { + return match effect { Effect::Save { connection_type, provider, base_url, api_key, - } => { - return ScreenControl::Exit(Some(SaveData { - connection_type, - provider, - base_url, - api_key, - })); - } - Effect::Exit => return ScreenControl::Exit(None), - } + } => ScreenControl::Exit(Some(SaveData { + connection_type, + provider, + base_url, + api_key, + })), + Effect::Exit => ScreenControl::Exit(None), + }; } ScreenControl::Continue } diff --git a/apps/cli/src/commands/entry/ui/command_input.rs b/apps/cli/src/commands/entry/ui/command_input.rs index 4410a9f44b..a472dbe5c5 100644 --- a/apps/cli/src/commands/entry/ui/command_input.rs +++ b/apps/cli/src/commands/entry/ui/command_input.rs @@ -8,16 +8,11 @@ use ratatui::{ use crate::theme::Theme; +#[derive(Default)] pub struct CursorState { pub position: Option, } -impl Default for CursorState { - fn default() -> Self { - Self { position: None } - } -} - pub struct CommandInput<'a> { value: &'a str, cursor_col: usize, diff --git a/apps/cli/src/commands/listen/mod.rs b/apps/cli/src/commands/listen/mod.rs index c9b4dc7dda..3965e4149a 100644 --- a/apps/cli/src/commands/listen/mod.rs +++ b/apps/cli/src/commands/listen/mod.rs @@ -55,15 +55,13 @@ impl ListenScreen { fn apply_effects(&mut self, effects: Vec) -> ScreenControl { for effect in effects { - match effect { - Effect::Exit { force } => { - return ScreenControl::Exit(Output { - elapsed: self.app.elapsed(), - force_quit: force, - segments: self.app.segments(), - }); - } - } + return match effect { + Effect::Exit { force } => ScreenControl::Exit(Output { + elapsed: self.app.elapsed(), + force_quit: force, + segments: self.app.segments(), + }), + }; } ScreenControl::Continue diff --git a/apps/cli/src/commands/sessions/app.rs b/apps/cli/src/commands/sessions/app.rs index 1532e82c46..9fc6af47c8 100644 --- a/apps/cli/src/commands/sessions/app.rs +++ b/apps/cli/src/commands/sessions/app.rs @@ -74,10 +74,10 @@ impl App { Vec::new() } KeyCode::Enter => { - if let Some(idx) = self.list_state.selected() { - if let Some(session) = self.sessions.get(idx) { - return vec![Effect::Select(session.id.clone())]; - } + if let Some(idx) = self.list_state.selected() + && let Some(session) = self.sessions.get(idx) + { + return vec![Effect::Select(session.id.clone())]; } Vec::new() } diff --git a/apps/cli/src/commands/sessions/mod.rs b/apps/cli/src/commands/sessions/mod.rs index bfa929bff2..851157ec21 100644 --- a/apps/cli/src/commands/sessions/mod.rs +++ b/apps/cli/src/commands/sessions/mod.rs @@ -28,10 +28,10 @@ struct SessionsScreen { impl SessionsScreen { fn apply_effects(&mut self, effects: Vec) -> ScreenControl> { for effect in effects { - match effect { - Effect::Select(id) => return ScreenControl::Exit(Some(id)), - Effect::Exit => return ScreenControl::Exit(None), - } + return match effect { + Effect::Select(id) => ScreenControl::Exit(Some(id)), + Effect::Exit => ScreenControl::Exit(None), + }; } ScreenControl::Continue } diff --git a/apps/cli/src/config/stt.rs b/apps/cli/src/config/stt.rs index 1e824884ac..b621053047 100644 --- a/apps/cli/src/config/stt.rs +++ b/apps/cli/src/config/stt.rs @@ -55,6 +55,7 @@ impl Provider { } } + #[allow(clippy::wrong_self_convention)] fn to_batch_provider(&self) -> BatchProvider { match self { Provider::Deepgram => BatchProvider::Deepgram, diff --git a/apps/cli/src/theme.rs b/apps/cli/src/theme.rs index d069419e4c..0eb42f243c 100644 --- a/apps/cli/src/theme.rs +++ b/apps/cli/src/theme.rs @@ -2,6 +2,7 @@ use hypr_cli_editor::StyleSheet; use ratatui::style::{Color, Modifier, Style}; #[derive(Debug, Clone, Copy)] +#[allow(dead_code)] pub struct Theme { pub bg: Color, pub accent: Style,