Apply clippy fixes and code improvements #1890
Merged
+61
−75
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
This PR applies various clippy-suggested fixes across the codebase, improving code quality and idiomatic Rust usage. Changes include:
min/maxchains withclamp()for cleaner bounds checkingwhile letinstead ofloop { match ... }patternsunsafespeaker: speaker→speaker)is_multiple_of()instead of modulo comparisonif letpatterns where appropriate.into()and borrow operationsunwrap_or_default()instead of match on ResultUpdates since last revision
mutkeyword onbuildervariable inplugins/windows/src/window/v1.rswith#[allow(unused_mut)]. The variable is reassigned in#[cfg(target_os = "macos")]and#[cfg(target_os = "windows")]blocks, somutis required on those platforms even though clippy on Linux suggested removing it.Review & Testing Checklist for Human
unsafemarking onrust_on_notification_confirmandrust_on_notification_dismissinnotification-macos/src/lib.rs- These extern C functions now require unsafe to call from Rust. Confirm no Rust code calls these directly (they appear to be callbacks from Swift/ObjC).clamp()behavior matches originalmin/maxchains - The semantic should be identical, but worth a quick sanity check onaudio-utilsandtranscribe-moonshinechanges.transcribe-deepgramservice had its nested if-let patterns collapsed; verify Deepgram transcription still works correctly.Recommended test plan: Run the desktop app locally with
ONBOARDING=0 pnpm -F desktop tauri devand test a recording session to verify transcription functionality is unaffected.Notes
cargo clippy --fixwith some manual adjustmentsnotification-macos,notch,tcc) couldn't be fully compiled on Linux, but the changes are straightforwardbuildervariable in windows plugin) required special handling since clippy on Linux doesn't see the cfg-gated reassignmentsLink to Devin run: https://app.devin.ai/sessions/ccbfa3019f6445cdaae0f2c3dc33bbf2
Requested by: unknown ()