Skip to content

fix: apply cargo clippy fixes#4691

Closed
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
devin/1774137752-clippy-fixes
Closed

fix: apply cargo clippy fixes#4691
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
devin/1774137752-clippy-fixes

Conversation

@devin-ai-integration
Copy link
Contributor

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

Summary

Applies cargo clippy --fix auto-fixes and manual fixes across the workspace:

  • Flatten nested if/if-let into let-chains: in owhisper-client/cactus/batch.rs, transcript/label.rs, transcript/segments/collect.rs, transcript/segments/speakers.rs, and plugins/tray/src/ext.rs
  • Simplify boolean expression (De Morgan's law): in transcript/segments/speakers.rs!word.is_final && !(a && b)!(word.is_final || a && b)
  • Remove needless Ok(x?) wrapper: in listener-core/actors/session/supervisor/children.rs
  • Remove unnecessary explicit lifetime 'a: on partition_tokens_by_word_finality in owhisper-client/soniox/live.rs
  • Exclude plugins/apple-contact and plugins/pdf from Cargo workspace: directories without Cargo.toml that the workspace glob picks up

Review & Testing Checklist for Human

  • Verify boolean simplification in speakers.rs:148: The condition !word.is_final && !(identity.speaker_index.is_some() && identity.human_id.is_some()) was rewritten as !(word.is_final || identity.speaker_index.is_some() && identity.human_id.is_some()). This relies on && binding tighter than || in Rust — confirm the operator precedence preserves the original semantics.
  • Verify let-chain flattening in speakers.rs remember_identity (line ~168): The let Some(human_id) = identity.human_id.clone() was hoisted into the outer if chain that already checks identity.human_id.is_some(). Confirm the insert still only fires under the same conditions as before.
  • Verify let-chain in label.rs: The flattening merges only the outer two conditions; the inner if let Some(name) and the return "You" fallthrough remain inside the block. Confirm return "You" still only executes when channel == DirectMic && self_human_id.is_some() && name lookup fails.
  • Build on macOS: These changes were validated with cargo clippy on Linux (excluding macOS-only crates). A macOS build would give full confidence.

Notes

  • Several workspace members (tools, control-tauri, tcc, notch, am2, cactus, llm-cactus, transcribe-cactus, local-stt-server) couldn't be checked on Linux due to macOS-only or ARM-only dependencies. Any clippy warnings in those crates remain unaddressed.
  • Only dead_code warnings remain after these fixes (unused functions/variants likely kept for future use).
  • CI failures on macOS (cactus too-many-arguments), Windows (ringbuf API mismatch), and e2e are pre-existing on main and unrelated to this PR.

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

@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 22, 2026

Deploy Preview for hyprnote-storybook canceled.

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

@netlify
Copy link

netlify bot commented Mar 22, 2026

Deploy Preview for hyprnote canceled.

Name Link
🔨 Latest commit 7fad98a
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/69bf3a5a6090e5000899836e

- Remove needless Ok(x?) pattern in listener-core
- Simplify boolean expression in transcript speakers
- Collapse nested if-let into let-chains in tray ext
- Flatten nested if-let chains in owhisper-client and transcript crates (auto-fix)
- Exclude plugins/apple-contact and plugins/pdf from Cargo workspace (no Cargo.toml)

Co-Authored-By: bot_apk <apk@cognition.ai>
@devin-ai-integration devin-ai-integration bot force-pushed the devin/1774137752-clippy-fixes branch from 09dd42f to 12ac519 Compare March 22, 2026 00:22
Co-Authored-By: bot_apk <apk@cognition.ai>
@ComputelessComputer
Copy link
Collaborator

Closing cargo clippy PR - no longer needed.

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.

1 participant