fix: apply cargo clippy fixes#4553
Closed
devin-ai-integration[bot] wants to merge 4 commits intomainfrom
Closed
Conversation
- Remove unnecessary .to_string() in posthog event creation - Flatten nested if-let chains using let-chains syntax - Remove unnecessary lifetime annotations in group_by_session_id - Add Safety doc section for unsafe extern C functions - Exclude plugins/cli2 from workspace (no Cargo.toml) 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 hyprnote-storybook canceled.
|
✅ Deploy Preview for hyprnote canceled.
|
Co-Authored-By: bot_apk <apk@cognition.ai>
- Exclude plugins/apple-contact and plugins/pdf from workspace (no Cargo.toml) - Flatten nested if-let in cactus batch SSE parser using let-chains - Remove unnecessary lifetime annotations in soniox partition_tokens_by_word_finality 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 remaining clippy suggestions across the workspace. After mergingmain, most initial fixes were already upstream; this PR contains the remaining items.Changes:
plugins/apple-contactandplugins/pdffrom workspace (directories exist but have noCargo.toml)if let/ifinto let-chains syntax, with dprint-compliant formattingpartition_tokens_by_word_finalitywhere elision appliesReview & Testing Checklist for Human
crates/owhisper-client/src/adapter/cactus/batch.rspreserves the original control flow — the innerif channel.alternatives...block must still only execute when the outer pattern match succeeds. The old code wasif let { if cond { body } }and the new code isif let && cond { body }— these should be equivalent, but confirm by inspection.plugins/apple-contactandplugins/pdfshould indeed be excluded from the Cargo workspace (they currently have noCargo.toml)Suggested test plan: Since these are Rust-only changes to transcription adapter code, run
cargo check --workspaceandcargo clippy --workspaceon a macOS build environment (where more crates compile) to verify no regressions. No runtime behavior should change.Notes
desktop_cifailures in CI are a pre-existing TypeScript error onmain('previewLabel' is declared but its value is never readinsession-preview-card.tsx) — unrelated to this PR, which only touches Rust files andCargo.toml. None of the failed checks are marked as required.audio,tcc,notch,cactus-sys) depend on macOS-only or platform-specific libraries and could not be fully clippy-checked on Linux. Warnings in those crates were not addressed.audiocrate has dead-code warnings (did_pop_chunk,convert_and_push_to_ringbuf,push_f32_to_ringbuf,has_buffered_samples) that remain — these are in a crate excluded from this check run.Link to Devin Session: https://app.devin.ai/sessions/b9be01de46284a1982f5834efb9185e1
Requested by: bot_apk