Skip to content

fix: apply cargo clippy suggestions#4639

Open
devin-ai-integration[bot] wants to merge 9 commits intomainfrom
devin/1773792308-clippy-fixes
Open

fix: apply cargo clippy suggestions#4639
devin-ai-integration[bot] wants to merge 9 commits intomainfrom
devin/1773792308-clippy-fixes

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Mar 18, 2026

Summary

Ran cargo clippy --fix and manually applied all remaining clippy suggestions across the workspace, including platform-specific crates that could only be checked in CI. Changes include:

  • Collapsed nested if/if-let chains into combined let-chains in 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)
  • Simplified boolean expression in transcript/segments/speakers.rs (nonminimal_bool — applied De Morgan's law)
  • Removed unnecessary explicit lifetime 'a from partition_tokens_by_word_finality in owhisper-client/soniox/live.rs (lifetime elision suffices)
  • Added #[allow(clippy::too_many_arguments)] to functions in cactus/stt/stream.rs, transcribe-cactus batch/streaming modules, and transcribe-proxy (builder, handler)
  • Added #[allow(clippy::large_enum_variant)] to enums in transcribe-proxy (coordinator, payload)
  • Added #[allow(dead_code)] to items in cli-editor/buffer.rs, listener-core recorder subsystem (memory sink, encoder, retained audio) that are used only on certain platforms
  • Replaced needless_range_loop with iter().enumerate().take() in transcribe-cactus/src/service/streaming/session.rs and audio-actual/src/rt_ring.rs (4 locations)
  • Removed unnecessary Ok() wrapper in listener-core/session/supervisor/children.rs
  • Added plugins/apple-contact and plugins/pdf to workspace exclude list — these directories contain only node_modules with no Cargo.toml, causing workspace resolution failures

All changes are mechanical clippy fixes with no intended behavioral changes.

Review & Testing Checklist for Human

  • Verify De Morgan simplification in 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 is Some).
  • Verify needless_range_loop refactors: Changed from for i in 0..count { scratch[i] = ... } to for (i, slot) in scratch.iter_mut().enumerate().take(count) { *slot = ... } in rt_ring.rs (4 sites) and a similar pattern in session.rs. Confirm no index-based mutation was missed and that the take() bound matches the original loop bound.
  • Verify children.rs Ok-removal: Ok(spawn_recorder(sup, &ctx).await?)spawn_recorder(sup, &ctx).await. Both should have the same return type for spawn_with_retry, but confirm the error type aligns.
  • Run cargo clippy on 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

  • The dead_code allows in listener-core suppress warnings for the in-memory recording path, which is conditionally compiled but not currently wired into the active RecordingMode::Disk code path. The code is still used in tests.
  • dprint uses rustfmt --edition 2024 for Rust formatting; cargo clippy --fix auto-fixes initially had inconsistent indentation that was corrected with rustfmt.

Link to Devin session: https://app.devin.ai/sessions/f07b44eaebc3459bb585d20957c502a2

@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@netlify
Copy link

netlify bot commented Mar 18, 2026

Deploy Preview for hyprnote canceled.

Name Link
🔨 Latest commit c09622e
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/69ba0dd3a0c3e7000882675b

@netlify
Copy link

netlify bot commented Mar 18, 2026

Deploy Preview for hyprnote-storybook canceled.

Name Link
🔨 Latest commit c09622e
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/69ba0dd35c2f530008052562

- 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>
@devin-ai-integration devin-ai-integration bot force-pushed the devin/1773792308-clippy-fixes branch from b86645a to 5c4c2f6 Compare March 18, 2026 00:23
devin-ai-integration bot and others added 8 commits March 18, 2026 00:37
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants