fix: apply cargo clippy suggestions#4639
Open
devin-ai-integration[bot] wants to merge 9 commits intomainfrom
Open
fix: apply cargo clippy suggestions#4639devin-ai-integration[bot] wants to merge 9 commits intomainfrom
devin-ai-integration[bot] wants to merge 9 commits intomainfrom
Conversation
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 hyprnote canceled.
|
✅ Deploy Preview for hyprnote-storybook canceled.
|
- 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 <apk@cognition.ai>
b86645a to
5c4c2f6
Compare
Co-Authored-By: bot_apk <apk@cognition.ai>
Co-Authored-By: bot_apk <apk@cognition.ai>
…uments, needless_range_loop) Co-Authored-By: bot_apk <apk@cognition.ai>
Co-Authored-By: bot_apk <apk@cognition.ai>
…uments, collapsible_if, large_enum_variant, needless_ok) Co-Authored-By: bot_apk <apk@cognition.ai>
…y_lazy_evaluations, and formatting Co-Authored-By: bot_apk <apk@cognition.ai>
…, derivable_impls, wrong_self_convention) Co-Authored-By: bot_apk <apk@cognition.ai>
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
Ran
cargo clippy --fixand manually applied all remaining clippy suggestions across the workspace, including platform-specific crates that could only be checked in CI. Changes include:owhisper-client(cactus batch adapter),transcript/label.rs,transcript/segments/collect.rs,transcript/segments/speakers.rs,device-monitor/src/macos.rs,cli-editor/src/highlight.rs,transcribe-proxy(handler, coordinator, io)transcript/segments/speakers.rs(nonminimal_bool— applied De Morgan's law)'afrompartition_tokens_by_word_finalityinowhisper-client/soniox/live.rs(lifetime elision suffices)#[allow(clippy::too_many_arguments)]to functions incactus/stt/stream.rs,transcribe-cactusbatch/streaming modules, andtranscribe-proxy(builder, handler)#[allow(clippy::large_enum_variant)]to enums intranscribe-proxy(coordinator, payload)#[allow(dead_code)]to items incli-editor/buffer.rs,listener-corerecorder subsystem (memory sink, encoder, retained audio) that are used only on certain platformsneedless_range_loopwithiter().enumerate().take()intranscribe-cactus/src/service/streaming/session.rsandaudio-actual/src/rt_ring.rs(4 locations)Ok()wrapper inlistener-core/session/supervisor/children.rsplugins/apple-contactandplugins/pdfto workspace exclude list — these directories contain onlynode_moduleswith noCargo.toml, causing workspace resolution failuresAll changes are mechanical clippy fixes with no intended behavioral changes.
Review & Testing Checklist for Human
speakers.rs:136: The original!word.is_final && !(a.is_some() && b.is_some())was rewritten as!(word.is_final || a.is_some() && b.is_some()). Operator precedence means&&still binds tighter than||inside the negation, so this should be equivalent — but confirm the speaker identity fallback logic behaves identically in edge cases (e.g.,is_final=false, one of speaker_index/human_id isSome).needless_range_looprefactors: Changed fromfor i in 0..count { scratch[i] = ... }tofor (i, slot) in scratch.iter_mut().enumerate().take(count) { *slot = ... }inrt_ring.rs(4 sites) and a similar pattern insession.rs. Confirm no index-based mutation was missed and that thetake()bound matches the original loop bound.children.rsOk-removal:Ok(spawn_recorder(sup, &ctx).await?)→spawn_recorder(sup, &ctx).await. Both should have the same return type forspawn_with_retry, but confirm the error type aligns.cargo clippyon macOS to verify no remaining warnings after these fixes. Several crates (listener-core,cli-editor,audio-actual,device-monitor) only compile or lint on macOS, so Linux CI alone is insufficient.Notes
dead_codeallows inlistener-coresuppress warnings for the in-memory recording path, which is conditionally compiled but not currently wired into the activeRecordingMode::Diskcode path. The code is still used in tests.dprintusesrustfmt --edition 2024for Rust formatting;cargo clippy --fixauto-fixes initially had inconsistent indentation that was corrected withrustfmt.Link to Devin session: https://app.devin.ai/sessions/f07b44eaebc3459bb585d20957c502a2