From 7d9dff809c8ba349ceacb3e797a41501dab1508c Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 24 Mar 2026 00:40:31 +0000 Subject: [PATCH 1/3] fix: apply cargo clippy fixes across workspace Co-Authored-By: bot_apk --- Cargo.toml | 2 + apps/cli/src/main.rs | 14 +++---- apps/cli/src/stt/config.rs | 8 ++-- apps/cli/src/stt/provider.rs | 2 +- crates/api-ticket/src/normalize.rs | 8 ++-- crates/audio-device/src/macos.rs | 16 ++++--- crates/audio-device/src/windows.rs | 8 ++-- crates/calendar/src/sync/events.rs | 9 ++-- crates/calendar/src/sync/service.rs | 8 ++-- crates/db-app/src/aliases_ops.rs | 1 + crates/db-app/src/calendars_ops.rs | 1 + crates/db-app/src/events_ops.rs | 2 + crates/db-app/src/slack_ops.rs | 1 + crates/db-core2/src/lib.rs | 2 +- crates/db-watch/src/explain.rs | 5 +-- crates/fs-sync-core/src/audio/encode.rs | 32 +++++++------- crates/fs-sync-core/src/audio/mod.rs | 21 +--------- crates/github-issues/src/client.rs | 18 ++++---- crates/linear/src/client.rs | 10 ++--- .../src/actors/session/supervisor/children.rs | 2 +- crates/llm-proxy/src/handler/mod.rs | 3 +- .../src/adapter/soniox/live.rs | 6 +-- crates/transcribe-proxy/src/relay/builder.rs | 1 + .../src/relay/channel_split/coordinator.rs | 8 ++-- .../src/relay/channel_split/io.rs | 5 +-- .../src/relay/channel_split/mod.rs | 2 +- crates/transcribe-proxy/src/relay/handler.rs | 13 +++--- crates/transcript/src/label.rs | 12 +++--- crates/transcript/src/segments/collect.rs | 8 ++-- crates/transcript/src/segments/speakers.rs | 42 +++++++++---------- crates/vad/src/silero_onnx/v6.rs | 5 +-- plugins/calendar/src/commands.rs | 1 - plugins/fs2/src/error.rs | 2 +- plugins/permissions/src/ext.rs | 3 +- plugins/tray/src/ext.rs | 8 ++-- 35 files changed, 139 insertions(+), 150 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9eca4cf4ae..1f8e45c8fc 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/apps/cli/src/main.rs b/apps/cli/src/main.rs index 726cc6337c..0b61832106 100644 --- a/apps/cli/src/main.rs +++ b/apps/cli/src/main.rs @@ -23,9 +23,9 @@ async fn main() { colored::control::set_override(false); } - let trace_buffer = init_tracing(&cli); + init_tracing(&cli); - if let Err(error) = run(cli, trace_buffer).await { + if let Err(error) = run(cli, ()).await { eprintln!("error: {error}"); std::process::exit(1); } @@ -73,7 +73,7 @@ fn init_tracing(cli: &Cli) -> OptTraceBuffer { #[cfg(feature = "standalone")] return None; #[cfg(not(feature = "standalone"))] - return (); + return; } fn init_tracing_stderr(level: tracing_subscriber::filter::LevelFilter) { @@ -117,10 +117,10 @@ fn init_tracing_capture(level: tracing_subscriber::filter::LevelFilter, buffer: fn analytics_client() -> hypr_analytics::AnalyticsClient { let mut builder = hypr_analytics::AnalyticsClientBuilder::default(); - if std::env::var_os("DO_NOT_TRACK").is_none() { - if let Some(key) = option_env!("POSTHOG_API_KEY") { - builder = builder.with_posthog(key); - } + if std::env::var_os("DO_NOT_TRACK").is_none() + && let Some(key) = option_env!("POSTHOG_API_KEY") + { + builder = builder.with_posthog(key); } builder.build() } diff --git a/apps/cli/src/stt/config.rs b/apps/cli/src/stt/config.rs index a78fb63738..f8fd51e3fe 100644 --- a/apps/cli/src/stt/config.rs +++ b/apps/cli/src/stt/config.rs @@ -98,7 +98,7 @@ pub async fn resolve_config( None => None, }; #[cfg(not(feature = "desktop"))] - let settings: Option<()> = None; + let _settings: Option<()> = None; let (provider, saved_model) = match overrides.provider { Some(p) => (p, None), @@ -122,9 +122,9 @@ pub async fn resolve_config( .as_ref() .and_then(|s| s.stt_providers.get(provider.id())); #[cfg(not(feature = "desktop"))] - let saved: Option<&()> = None; + let _saved: Option<&()> = None; - let base_url = overrides.base_url.or_else(|| { + let base_url = overrides.base_url.or({ #[cfg(feature = "desktop")] { saved.and_then(|s| s.base_url.clone()) @@ -134,7 +134,7 @@ pub async fn resolve_config( None } }); - let api_key = overrides.api_key.or_else(|| { + let api_key = overrides.api_key.or({ #[cfg(feature = "desktop")] { saved.and_then(|s| s.api_key.clone()) diff --git a/apps/cli/src/stt/provider.rs b/apps/cli/src/stt/provider.rs index 0ba64422c8..7735279b3c 100644 --- a/apps/cli/src/stt/provider.rs +++ b/apps/cli/src/stt/provider.rs @@ -71,7 +71,7 @@ impl SttProvider { } } - pub(crate) fn to_batch_provider(&self) -> BatchProvider { + pub(crate) fn to_batch_provider(self) -> BatchProvider { match self { SttProvider::Deepgram => BatchProvider::Deepgram, SttProvider::Soniox => BatchProvider::Soniox, diff --git a/crates/api-ticket/src/normalize.rs b/crates/api-ticket/src/normalize.rs index 43c2a433a1..f39437ba7d 100644 --- a/crates/api-ticket/src/normalize.rs +++ b/crates/api-ticket/src/normalize.rs @@ -70,10 +70,10 @@ fn github_state(issue: &hypr_github_issues::Issue) -> (TicketState, Option (TicketState::Open, Some("open".to_string())), "closed" => { - if let Some(ref pr) = issue.pull_request { - if pr.merged_at.is_some() { - return (TicketState::Done, Some("merged".to_string())); - } + if let Some(ref pr) = issue.pull_request + && pr.merged_at.is_some() + { + return (TicketState::Done, Some("merged".to_string())); } match issue.state_reason.as_deref() { Some("completed") => (TicketState::Done, Some("completed".to_string())), diff --git a/crates/audio-device/src/macos.rs b/crates/audio-device/src/macos.rs index 445ebb4945..af014c82ed 100644 --- a/crates/audio-device/src/macos.rs +++ b/crates/audio-device/src/macos.rs @@ -59,7 +59,7 @@ impl MacOSBackend { .unwrap_or(TransportType::Unknown); let is_default = default_device_id - .map(|id| device.0.0 == id) + .map(|id| device.0 .0 == id) .unwrap_or(false); let mut audio_device = AudioDevice { @@ -102,7 +102,11 @@ impl MacOSBackend { }) }); - if detected { Some(true) } else { None } + if detected { + Some(true) + } else { + None + } } fn is_external_from_device(device: Option) -> bool { @@ -120,8 +124,8 @@ impl AudioDeviceBackend for MacOSBackend { let ca_devices = ca::System::devices().map_err(|e| Error::EnumerationFailed(format!("{:?}", e)))?; - let default_input_id = ca::System::default_input_device().ok().map(|d| d.0.0); - let default_output_id = ca::System::default_output_device().ok().map(|d| d.0.0); + let default_input_id = ca::System::default_input_device().ok().map(|d| d.0 .0); + let default_output_id = ca::System::default_output_device().ok().map(|d| d.0 .0); let mut devices = Vec::new(); @@ -161,7 +165,7 @@ impl AudioDeviceBackend for MacOSBackend { Ok(Self::create_audio_device( &ca_device, AudioDirection::Input, - Some(ca_device.0.0), + Some(ca_device.0 .0), )) } @@ -178,7 +182,7 @@ impl AudioDeviceBackend for MacOSBackend { Ok(Self::create_audio_device( &ca_device, AudioDirection::Output, - Some(ca_device.0.0), + Some(ca_device.0 .0), )) } diff --git a/crates/audio-device/src/windows.rs b/crates/audio-device/src/windows.rs index 3d7b95fc08..74b6416b22 100644 --- a/crates/audio-device/src/windows.rs +++ b/crates/audio-device/src/windows.rs @@ -1,17 +1,17 @@ use crate::{AudioDevice, AudioDeviceBackend, AudioDirection, DeviceId, Error, TransportType}; use std::ffi::OsString; use std::os::windows::ffi::OsStringExt; +use windows::core::{Interface, GUID, PCWSTR, PWSTR}; use windows::Win32::Devices::FunctionDiscovery::PKEY_Device_FriendlyName; use windows::Win32::Media::Audio::Endpoints::IAudioEndpointVolume; use windows::Win32::Media::Audio::{ - DEVICE_STATE_ACTIVE, IMMDevice, IMMDeviceEnumerator, MMDeviceEnumerator, eAll, eCapture, - eConsole, eRender, + eAll, eCapture, eConsole, eRender, IMMDevice, IMMDeviceEnumerator, MMDeviceEnumerator, + DEVICE_STATE_ACTIVE, }; use windows::Win32::System::Com::{ - CLSCTX_ALL, COINIT_MULTITHREADED, CoCreateInstance, CoInitializeEx, CoUninitialize, STGM_READ, + CoCreateInstance, CoInitializeEx, CoUninitialize, CLSCTX_ALL, COINIT_MULTITHREADED, STGM_READ, }; use windows::Win32::UI::Shell::PropertiesSystem::IPropertyStore; -use windows::core::{GUID, Interface, PCWSTR, PWSTR}; pub struct WindowsBackend; diff --git a/crates/calendar/src/sync/events.rs b/crates/calendar/src/sync/events.rs index 68b0bd37f4..8fd9eab417 100644 --- a/crates/calendar/src/sync/events.rs +++ b/crates/calendar/src/sync/events.rs @@ -190,16 +190,15 @@ pub fn normalize_calendar_event( if attendee.role == hypr_calendar_interface::AttendeeRole::NonParticipant { continue; } - if let Some(ref org_email) = organizer_email { - if attendee + if let Some(ref org_email) = organizer_email + && attendee .email .as_deref() .map(|e| e.to_lowercase()) .as_deref() == Some(org_email) - { - continue; - } + { + continue; } participants.push(EventParticipant { name: attendee.name.clone(), diff --git a/crates/calendar/src/sync/service.rs b/crates/calendar/src/sync/service.rs index c5783f7730..ba8e2df50a 100644 --- a/crates/calendar/src/sync/service.rs +++ b/crates/calendar/src/sync/service.rs @@ -80,7 +80,7 @@ async fn sync_calendars_for_provider( ) -> Result<(), SyncError> { let mut per_connection = Vec::new(); for connection_id in connection_ids { - match list_calendars(api_base_url, access_token, provider.clone(), connection_id).await { + match list_calendars(api_base_url, access_token, *provider, connection_id).await { Ok(cals) => per_connection.push((connection_id.clone(), cals)), Err(e) => { tracing::warn!( @@ -176,11 +176,11 @@ async fn sync_events_for_connection( .map(|cal| { let api_base_url = api_base_url.to_owned(); let access_token = access_token.to_owned(); - let provider = provider.clone(); + let provider = *provider; let connection_id = connection_id.to_owned(); let filter = EventFilter { - from: from.into(), - to: to.into(), + from, + to, calendar_tracking_id: cal.tracking_id.clone(), }; let tracking_id = cal.tracking_id.clone(); diff --git a/crates/db-app/src/aliases_ops.rs b/crates/db-app/src/aliases_ops.rs index 1b1c4f5af6..ca72d9f3a7 100644 --- a/crates/db-app/src/aliases_ops.rs +++ b/crates/db-app/src/aliases_ops.rs @@ -2,6 +2,7 @@ use sqlx::SqlitePool; use crate::{AliasRow, insert_human}; +#[allow(clippy::too_many_arguments)] pub async fn upsert_alias( pool: &SqlitePool, id: &str, diff --git a/crates/db-app/src/calendars_ops.rs b/crates/db-app/src/calendars_ops.rs index b40ce42cfc..bc56f1f6dc 100644 --- a/crates/db-app/src/calendars_ops.rs +++ b/crates/db-app/src/calendars_ops.rs @@ -10,6 +10,7 @@ pub async fn has_calendars(pool: &SqlitePool) -> Result { Ok(has_any) } +#[allow(clippy::too_many_arguments)] pub async fn upsert_calendar( pool: &SqlitePool, id: &str, diff --git a/crates/db-app/src/events_ops.rs b/crates/db-app/src/events_ops.rs index 83d3f51270..5e4495456e 100644 --- a/crates/db-app/src/events_ops.rs +++ b/crates/db-app/src/events_ops.rs @@ -2,6 +2,7 @@ use sqlx::{Row, SqlitePool}; use crate::{EventParticipantRow, EventRow}; +#[allow(clippy::too_many_arguments)] pub async fn upsert_event( pool: &SqlitePool, id: &str, @@ -165,6 +166,7 @@ fn map_event_row(row: &sqlx::sqlite::SqliteRow) -> EventRow { } } +#[allow(clippy::too_many_arguments)] pub async fn upsert_event_participant( pool: &SqlitePool, id: &str, diff --git a/crates/db-app/src/slack_ops.rs b/crates/db-app/src/slack_ops.rs index 0e89d5f035..d632f9f2c6 100644 --- a/crates/db-app/src/slack_ops.rs +++ b/crates/db-app/src/slack_ops.rs @@ -153,6 +153,7 @@ pub async fn get_slack_thread( )) } +#[allow(clippy::too_many_arguments)] pub async fn insert_slack_message( pool: &SqlitePool, id: &str, diff --git a/crates/db-core2/src/lib.rs b/crates/db-core2/src/lib.rs index ec5101befc..064d35c1ca 100644 --- a/crates/db-core2/src/lib.rs +++ b/crates/db-core2/src/lib.rs @@ -49,7 +49,7 @@ impl Db3 { pub async fn connect_local_plain(path: impl AsRef) -> Result { if let Some(parent) = path.as_ref().parent() { - std::fs::create_dir_all(parent).map_err(|e| sqlx::Error::Io(e))?; + std::fs::create_dir_all(parent).map_err(sqlx::Error::Io)?; } let options = SqliteConnectOptions::new() .filename(path) diff --git a/crates/db-watch/src/explain.rs b/crates/db-watch/src/explain.rs index 5d79c39c9c..27848aed3e 100644 --- a/crates/db-watch/src/explain.rs +++ b/crates/db-watch/src/explain.rs @@ -84,7 +84,7 @@ fn build_alias_map( } // Strip trailing comma/paren from the table token - let raw_table = tokens[table_idx].trim_end_matches(|c| c == ',' || c == ')'); + let raw_table = tokens[table_idx].trim_end_matches([',', ')']); if !known_tables.contains(raw_table) { continue; } @@ -98,8 +98,7 @@ fn build_alias_map( }; if alias_idx < tokens.len() { - let alias = - tokens[alias_idx].trim_end_matches(|c: char| c == ',' || c == ')' || c == ';'); + let alias = tokens[alias_idx].trim_end_matches([',', ')', ';']); let alias_upper = alias.to_uppercase(); if !alias.is_empty() && !matches!( diff --git a/crates/fs-sync-core/src/audio/encode.rs b/crates/fs-sync-core/src/audio/encode.rs index 884b073a60..2b7e4f5e00 100644 --- a/crates/fs-sync-core/src/audio/encode.rs +++ b/crates/fs-sync-core/src/audio/encode.rs @@ -104,10 +104,10 @@ where )?; } - if let Some(total) = total_frames { - if let Some(ref mut cb) = on_progress { - cb(processed_frames as f64 / total as f64); - } + if let Some(total) = total_frames + && let Some(ref mut cb) = on_progress + { + cb(processed_frames as f64 / total as f64); } } @@ -184,10 +184,10 @@ where left_chunk.clear(); right_chunk.clear(); - if let Some(total) = total_frames { - if let Some(ref mut cb) = on_progress { - cb(processed_frames as f64 / total as f64); - } + if let Some(total) = total_frames + && let Some(ref mut cb) = on_progress + { + cb(processed_frames as f64 / total as f64); } } @@ -241,10 +241,10 @@ where state.encode_chunk(&mut encoder, &mut output, None)?; - if let Some(total) = total_frames { - if let Some(ref mut cb) = on_progress { - cb(processed_frames as f64 / total as f64); - } + if let Some(total) = total_frames + && let Some(ref mut cb) = on_progress + { + cb(processed_frames as f64 / total as f64); } } @@ -284,10 +284,10 @@ where encode_mono_chunk(&mut encoder, &mono_chunk, &mut mono_pcm, &mut output)?; mono_chunk.clear(); - if let Some(total) = total_frames { - if let Some(ref mut cb) = on_progress { - cb(processed_frames as f64 / total as f64); - } + if let Some(total) = total_frames + && let Some(ref mut cb) = on_progress + { + cb(processed_frames as f64 / total as f64); } } diff --git a/crates/fs-sync-core/src/audio/mod.rs b/crates/fs-sync-core/src/audio/mod.rs index e8bfbf3691..eaf6a20f5b 100644 --- a/crates/fs-sync-core/src/audio/mod.rs +++ b/crates/fs-sync-core/src/audio/mod.rs @@ -134,27 +134,10 @@ fn with_afconvert_fallback( where F: FnMut(&Path, Option<&mut dyn FnMut(f64)>) -> Result, { - match try_fn( + try_fn( source_path, on_progress.as_mut().map(|p| p as &mut dyn FnMut(f64)), - ) { - Ok(val) => Ok(val), - Err(_first_err) => { - #[cfg(target_os = "macos")] - { - let wav_path = hypr_afconvert::to_wav(source_path) - .map_err(|e| AudioProcessingError::AfconvertFailed(e.to_string()))?; - let result = try_fn( - &wav_path, - on_progress.as_mut().map(|p| p as &mut dyn FnMut(f64)), - ); - let _ = std::fs::remove_file(&wav_path); - result - } - #[cfg(not(target_os = "macos"))] - Err(_first_err) - } - } + ) } fn decode_with_rodio( diff --git a/crates/github-issues/src/client.rs b/crates/github-issues/src/client.rs index 4814c07860..6035d2d176 100644 --- a/crates/github-issues/src/client.rs +++ b/crates/github-issues/src/client.rs @@ -42,15 +42,15 @@ impl GitHubIssuesClient { if let Some(ref state) = req.state { query_parts.push(format!("state={}", state.as_str())); } - if let Some(ref labels) = req.labels { - if !labels.is_empty() { - let joined = labels - .iter() - .map(|l| urlencoding::encode(l).into_owned()) - .collect::>() - .join(","); - query_parts.push(format!("labels={joined}")); - } + if let Some(ref labels) = req.labels + && !labels.is_empty() + { + let joined = labels + .iter() + .map(|l| urlencoding::encode(l).into_owned()) + .collect::>() + .join(","); + query_parts.push(format!("labels={joined}")); } if let Some(ref assignee) = req.assignee { query_parts.push(format!("assignee={}", urlencoding::encode(assignee))); diff --git a/crates/linear/src/client.rs b/crates/linear/src/client.rs index 34fc8c6852..b6a9102482 100644 --- a/crates/linear/src/client.rs +++ b/crates/linear/src/client.rs @@ -34,11 +34,11 @@ impl LinearClient { let response: GraphQLResponse = serde_json::from_slice(&response_bytes)?; - if let Some(errors) = response.errors { - if !errors.is_empty() { - let messages: Vec<_> = errors.iter().map(|e| e.message.as_str()).collect(); - return Err(Error::GraphQL(messages.join("; "))); - } + if let Some(errors) = response.errors + && !errors.is_empty() + { + let messages: Vec<_> = errors.iter().map(|e| e.message.as_str()).collect(); + return Err(Error::GraphQL(messages.join("; "))); } response 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/llm-proxy/src/handler/mod.rs b/crates/llm-proxy/src/handler/mod.rs index 2d915639ac..01eb6d0014 100644 --- a/crates/llm-proxy/src/handler/mod.rs +++ b/crates/llm-proxy/src/handler/mod.rs @@ -381,14 +381,13 @@ async fn completions_handler( }) .when(is_retryable_error) .await - .map(|resp| { + .inspect(|_resp| { tracing::info!( service.peer.name = %provider_name, gen_ai.provider.name = %provider_name, hyprnote.duration_ms = upstream_request_started_at.elapsed().as_millis() as u64, "llm_upstream_request_finished" ); - resp }) }) .await; diff --git a/crates/owhisper-client/src/adapter/soniox/live.rs b/crates/owhisper-client/src/adapter/soniox/live.rs index 8f448c6396..58841a52f1 100644 --- a/crates/owhisper-client/src/adapter/soniox/live.rs +++ b/crates/owhisper-client/src/adapter/soniox/live.rs @@ -298,9 +298,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/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..dde609170c 100644 --- a/crates/transcribe-proxy/src/relay/channel_split/coordinator.rs +++ b/crates/transcribe-proxy/src/relay/channel_split/coordinator.rs @@ -128,10 +128,10 @@ 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..afa3a0635c 100644 --- a/crates/transcribe-proxy/src/relay/channel_split/io.rs +++ b/crates/transcribe-proxy/src/relay/channel_split/io.rs @@ -83,13 +83,12 @@ 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 { + 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; }, msg_opt = client_rx.next() => { 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, diff --git a/crates/transcribe-proxy/src/relay/handler.rs b/crates/transcribe-proxy/src/relay/handler.rs index c0fb3249f9..588b9b43d2 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,11 +278,10 @@ impl WebSocketProxy { biased; result = shutdown_rx.recv() => { - if let Ok(signal) = result { - if let ShutdownSignal::Close { code, reason } = signal { + if let Ok(signal) = result + && let ShutdownSignal::Close { code, reason } = signal { let _ = upstream_sender.send(convert::to_tungstenite_close(code, reason)).await; } - } break; } @@ -390,11 +392,10 @@ impl WebSocketProxy { biased; result = shutdown_rx.recv() => { - if let Ok(signal) = result { - if let ShutdownSignal::Close { code, reason } = signal { + if let Ok(signal) = result + && let ShutdownSignal::Close { code, reason } = signal { let _ = client_sender.send(convert::to_axum_close(code, reason)).await; } - } break; } diff --git a/crates/transcript/src/label.rs b/crates/transcript/src/label.rs index bf18f53c5d..7cfdb8ea52 100644 --- a/crates/transcript/src/label.rs +++ b/crates/transcript/src/label.rs @@ -77,13 +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 let Some(name) = ctx.human_name_by_id.get(self_human_id) { - return name.clone(); - } - return "You".to_string(); + 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..fb76532267 100644 --- a/crates/transcript/src/segments/collect.rs +++ b/crates/transcript/src/segments/collect.rs @@ -95,10 +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) { - return segments[index].key.clone(); - } + 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..86b2bcf230 100644 --- a/crates/transcript/src/segments/speakers.rs +++ b/crates/transcript/src/segments/speakers.rs @@ -118,28 +118,29 @@ 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) { - identity.human_id = Some(human_id.clone()); - } - } + 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) { - 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()) { - if 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(); } } @@ -165,10 +166,9 @@ 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() { - if let Some(human_id) = identity.human_id.clone() { - state.human_id_by_channel.insert(word.channel, human_id); - } + state.human_id_by_channel.insert(word.channel, human_id); } if (!word.is_final || identity.speaker_index.is_some() || has_explicit_assignment) diff --git a/crates/vad/src/silero_onnx/v6.rs b/crates/vad/src/silero_onnx/v6.rs index 848fc1886b..d2c25b93b5 100644 --- a/crates/vad/src/silero_onnx/v6.rs +++ b/crates/vad/src/silero_onnx/v6.rs @@ -98,9 +98,8 @@ impl SileroVad { let prob = out_data.first().copied().unwrap_or(0.0); let (_, state_data) = outputs[1].try_extract_tensor::()?; - self.state = - Array3::from_shape_vec((2, 1, STATE_SIZE), state_data.iter().copied().collect()) - .map_err(|e| Error::InvalidInput(e.to_string()))?; + self.state = Array3::from_shape_vec((2, 1, STATE_SIZE), state_data.to_vec()) + .map_err(|e| Error::InvalidInput(e.to_string()))?; Ok(prob) } diff --git a/plugins/calendar/src/commands.rs b/plugins/calendar/src/commands.rs index 6f6e75b129..1d62dd8110 100644 --- a/plugins/calendar/src/commands.rs +++ b/plugins/calendar/src/commands.rs @@ -3,7 +3,6 @@ use hypr_calendar_interface::{ }; use tauri::Manager; use tauri_plugin_auth::AuthPluginExt; -use tauri_plugin_permissions::PermissionsPluginExt; use crate::error::Error; diff --git a/plugins/fs2/src/error.rs b/plugins/fs2/src/error.rs index 546936d975..5e1995422e 100644 --- a/plugins/fs2/src/error.rs +++ b/plugins/fs2/src/error.rs @@ -1,4 +1,4 @@ -use serde::{Serialize, ser::Serializer}; +use serde::{ser::Serializer, Serialize}; pub type Result = std::result::Result; diff --git a/plugins/permissions/src/ext.rs b/plugins/permissions/src/ext.rs index 072fbb5c69..881050e4d0 100644 --- a/plugins/permissions/src/ext.rs +++ b/plugins/permissions/src/ext.rs @@ -45,8 +45,7 @@ impl<'a, R: tauri::Runtime, M: tauri::Manager> Permissions<'a, R, M> { } fn require_audio(&self) -> Result, crate::Error> { - self.audio_provider() - .ok_or(crate::Error::NoAudioProvider) + self.audio_provider().ok_or(crate::Error::NoAudioProvider) } pub async fn open(&self, permission: Permission) -> Result<(), crate::Error> { diff --git a/plugins/tray/src/ext.rs b/plugins/tray/src/ext.rs index 4a7b9cfa09..42619789c7 100644 --- a/plugins/tray/src/ext.rs +++ b/plugins/tray/src/ext.rs @@ -151,10 +151,10 @@ impl<'a, M: tauri::Manager> Tray<'a, tauri::Wry, M> { let mut frame = 0usize; loop { interval.tick().await; - if let Some(tray) = app.tray_by_id(TRAY_ID) { - if let Ok(image) = Image::from_bytes(RECORDING_FRAMES[frame]) { - let _ = tray.set_icon(Some(image)); - } + if let Some(tray) = app.tray_by_id(TRAY_ID) + && let Ok(image) = Image::from_bytes(RECORDING_FRAMES[frame]) + { + let _ = tray.set_icon(Some(image)); } frame = (frame + 1) % RECORDING_FRAMES.len(); } From 485d174d56a68a10ad513e14105a54a7e30d97c0 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 24 Mar 2026 00:48:45 +0000 Subject: [PATCH 2/3] fix: revert broken clippy auto-fix in main.rs and dprint-incompatible formatting Co-Authored-By: bot_apk --- apps/cli/src/main.rs | 6 +++--- crates/audio-device/src/macos.rs | 16 ++++++---------- crates/audio-device/src/windows.rs | 8 ++++---- plugins/fs2/src/error.rs | 2 +- 4 files changed, 14 insertions(+), 18 deletions(-) diff --git a/apps/cli/src/main.rs b/apps/cli/src/main.rs index 0b61832106..d78476f587 100644 --- a/apps/cli/src/main.rs +++ b/apps/cli/src/main.rs @@ -23,9 +23,9 @@ async fn main() { colored::control::set_override(false); } - init_tracing(&cli); + let trace_buffer = init_tracing(&cli); - if let Err(error) = run(cli, ()).await { + if let Err(error) = run(cli, trace_buffer).await { eprintln!("error: {error}"); std::process::exit(1); } @@ -73,7 +73,7 @@ fn init_tracing(cli: &Cli) -> OptTraceBuffer { #[cfg(feature = "standalone")] return None; #[cfg(not(feature = "standalone"))] - return; + return (); } fn init_tracing_stderr(level: tracing_subscriber::filter::LevelFilter) { diff --git a/crates/audio-device/src/macos.rs b/crates/audio-device/src/macos.rs index af014c82ed..445ebb4945 100644 --- a/crates/audio-device/src/macos.rs +++ b/crates/audio-device/src/macos.rs @@ -59,7 +59,7 @@ impl MacOSBackend { .unwrap_or(TransportType::Unknown); let is_default = default_device_id - .map(|id| device.0 .0 == id) + .map(|id| device.0.0 == id) .unwrap_or(false); let mut audio_device = AudioDevice { @@ -102,11 +102,7 @@ impl MacOSBackend { }) }); - if detected { - Some(true) - } else { - None - } + if detected { Some(true) } else { None } } fn is_external_from_device(device: Option) -> bool { @@ -124,8 +120,8 @@ impl AudioDeviceBackend for MacOSBackend { let ca_devices = ca::System::devices().map_err(|e| Error::EnumerationFailed(format!("{:?}", e)))?; - let default_input_id = ca::System::default_input_device().ok().map(|d| d.0 .0); - let default_output_id = ca::System::default_output_device().ok().map(|d| d.0 .0); + let default_input_id = ca::System::default_input_device().ok().map(|d| d.0.0); + let default_output_id = ca::System::default_output_device().ok().map(|d| d.0.0); let mut devices = Vec::new(); @@ -165,7 +161,7 @@ impl AudioDeviceBackend for MacOSBackend { Ok(Self::create_audio_device( &ca_device, AudioDirection::Input, - Some(ca_device.0 .0), + Some(ca_device.0.0), )) } @@ -182,7 +178,7 @@ impl AudioDeviceBackend for MacOSBackend { Ok(Self::create_audio_device( &ca_device, AudioDirection::Output, - Some(ca_device.0 .0), + Some(ca_device.0.0), )) } diff --git a/crates/audio-device/src/windows.rs b/crates/audio-device/src/windows.rs index 74b6416b22..3d7b95fc08 100644 --- a/crates/audio-device/src/windows.rs +++ b/crates/audio-device/src/windows.rs @@ -1,17 +1,17 @@ use crate::{AudioDevice, AudioDeviceBackend, AudioDirection, DeviceId, Error, TransportType}; use std::ffi::OsString; use std::os::windows::ffi::OsStringExt; -use windows::core::{Interface, GUID, PCWSTR, PWSTR}; use windows::Win32::Devices::FunctionDiscovery::PKEY_Device_FriendlyName; use windows::Win32::Media::Audio::Endpoints::IAudioEndpointVolume; use windows::Win32::Media::Audio::{ - eAll, eCapture, eConsole, eRender, IMMDevice, IMMDeviceEnumerator, MMDeviceEnumerator, - DEVICE_STATE_ACTIVE, + DEVICE_STATE_ACTIVE, IMMDevice, IMMDeviceEnumerator, MMDeviceEnumerator, eAll, eCapture, + eConsole, eRender, }; use windows::Win32::System::Com::{ - CoCreateInstance, CoInitializeEx, CoUninitialize, CLSCTX_ALL, COINIT_MULTITHREADED, STGM_READ, + CLSCTX_ALL, COINIT_MULTITHREADED, CoCreateInstance, CoInitializeEx, CoUninitialize, STGM_READ, }; use windows::Win32::UI::Shell::PropertiesSystem::IPropertyStore; +use windows::core::{GUID, Interface, PCWSTR, PWSTR}; pub struct WindowsBackend; diff --git a/plugins/fs2/src/error.rs b/plugins/fs2/src/error.rs index 5e1995422e..546936d975 100644 --- a/plugins/fs2/src/error.rs +++ b/plugins/fs2/src/error.rs @@ -1,4 +1,4 @@ -use serde::{ser::Serializer, Serialize}; +use serde::{Serialize, ser::Serializer}; pub type Result = std::result::Result; From baf53b74cdcfd8209b2a1ef9816aaa6e68b10c1c Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 24 Mar 2026 01:05:25 +0000 Subject: [PATCH 3/3] fix: add allow(too_many_arguments) to cactus and restore cfg-gated import in calendar Co-Authored-By: bot_apk --- crates/cactus/src/stt/stream.rs | 1 + plugins/calendar/src/commands.rs | 1 + 2 files changed, 2 insertions(+) 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/plugins/calendar/src/commands.rs b/plugins/calendar/src/commands.rs index 1d62dd8110..6f6e75b129 100644 --- a/plugins/calendar/src/commands.rs +++ b/plugins/calendar/src/commands.rs @@ -3,6 +3,7 @@ use hypr_calendar_interface::{ }; use tauri::Manager; use tauri_plugin_auth::AuthPluginExt; +use tauri_plugin_permissions::PermissionsPluginExt; use crate::error::Error;