fix: apply cargo clippy fixes across workspace#4716
Closed
devin-ai-integration[bot] wants to merge 3 commits intomainfrom
Closed
fix: apply cargo clippy fixes across workspace#4716devin-ai-integration[bot] wants to merge 3 commits intomainfrom
devin-ai-integration[bot] wants to merge 3 commits intomainfrom
Conversation
Co-Authored-By: bot_apk <apk@cognition.ai>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
✅ Deploy Preview for char-cli-web canceled.
|
✅ Deploy Preview for hyprnote canceled.
|
… formatting Co-Authored-By: bot_apk <apk@cognition.ai>
…port in calendar Co-Authored-By: bot_apk <apk@cognition.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Applies
cargo clippy --fixauto-fixes and manually addresses remaining clippy warnings across the workspace. Changes include:if→ let chains: Nestedif let/ifblocks collapsed into single expressions using&&let chains (~15 sites across transcript, transcribe-proxy, calendar, tray, cli, api-ticket, fs-sync-core, github-issues, linear)owhisper-client(soniox adapter)transcript/segments/speakers.rs(!a && !(b && c)→!(a || b && c)).clone()with*dereference onCopytypes (CalendarProviderType).map_err(|e| sqlx::Error::Io(e))→.map_err(sqlx::Error::Io),.or_else(|| { block })→.or({ block }),.and_then(|_| x)→.and(x)too_many_argumentson DB upsert functions, websocket proxy internals, and cactus transcribe worker via#[allow(clippy::too_many_arguments)]_settings,_saved,_respto_batch_provider(&self)→to_batch_provider(self)sinceSttProviderisCopy.iter().copied().collect()with.to_vec()invad/silero_onnx/v6.rstrim_end_matches(|c| c == ',' || c == ')')→trim_end_matches([',', ')'])with_afconvert_fallbackmatch wrapper infs-sync-core/audio/mod.rs(plugins/apple-contactandplugins/pdfto workspace excludes (missing dirs)Updates since last revision
cargo clippy --fixauto-fix inapps/cli/src/main.rs— the auto-fixer incorrectly dropped thetrace_bufferreturn value frominit_tracing()and passed()torun(), causing a type mismatch (E0308) in CIcrates/audio-device/src/macos.rs,crates/audio-device/src/windows.rs,plugins/fs2/src/error.rs) —cargo fmtimport ordering and tuple field spacing (d.0 .0vsd.0.0) conflicted with the project's dprint configuration#[allow(clippy::too_many_arguments)]tocrates/cactus/src/stt/stream.rsrun_transcribe_worker— only compilable on macOS ARM, so couldn't be auto-fixed locally but caused CI failuresuse tauri_plugin_permissions::PermissionsPluginExtinplugins/calendar/src/commands.rs— clippy on Linux flagged it as unused, but it's required inside a#[cfg(target_os = "macos")]blockReview & Testing Checklist for Human
with_afconvert_fallbackgutted infs-sync-core/audio/mod.rs: The clippy auto-fix collapsed the entire match into a directtry_fn(...)call, removing the macOSafconvertfallback path. On Linux the oldErrarm was a no-op, so clippy simplified it — but the#[cfg(target_os = "macos")]block that retries viahypr_afconvert::to_wavwas deleted in the process. This is a behavioral regression on macOS. Either revert this hunk or re-add the fallback.if cond && let Pat = expr { }) were stabilized in Rust 1.87. Verify the project's toolchain supports this — if the CI toolchain is older, all the let chain transformations will fail to compile.speakers.rs: The expression!word.is_final && !(identity.speaker_index.is_some() && identity.human_id.is_some())was rewritten to!(word.is_final || identity.speaker_index.is_some() && identity.human_id.is_some()). These are logically equivalent by De Morgan's law, but this is core speaker identity logic — worth a second look.or_else→orinstt/config.rs: Changed lazy evaluation to eager evaluation. The inner expressions are side-effect-free so it's functionally equivalent, but confirm no#[cfg(feature = "desktop")]paths have expensive or stateful operations.Notes
listener-corerecorder,clicactus/path helpers) — these are only used on macOS/ARM and show as dead on Linux. Not addressed to avoid suppressing legitimate warnings on the target platform.large_size_difference_between_variantswarnings intranscribe-proxyare left as-is since boxing variants is an architectural decision.desktop,audio-actual,cactus, ortoolspackages locally due to platform dependencies (pipewire, Swift, ARM cactus-sys).cargo fmt(rustfmt) disagree on import ordering and tuple field spacing. All formatting was aligned to dprint since that's what CI enforces.check (windows-latest),e2e,desktop_ci) have pre-existing failures unrelated to this PR (e.g.,vacant_lenmethod missing inwasapion Windows,unrecognized subcommand 'connect'in e2e,no method named 'permissions'indesktopbuild).Link to Devin session: https://app.devin.ai/sessions/1b3536677f0745988a5641b8bf122f31