fix: resolve clippy pedantic warnings across workspace#3009
Open
olabi wants to merge 3 commits into
Open
Conversation
Address clippy::pedantic and clippy::all warnings without changing any public API or runtime behavior: - map().unwrap_or() → map_or() / is_ok_and() (8 instances) - match_same_arms: merge identical match arms (3 instances) - collapsible_match / unnested_or_patterns → if let (1 instance) - doc_markdown: backtick-wrap identifiers in doc comments (5 instances) - useless_format: format!(literal) → literal.to_string() (1 instance) - unnecessary_lazy_evaluations (1 instance) - redundant_closure (1 instance) - redundant match arm subsumed by wildcard (1 instance) - unused import (1 instance) - unnecessary mut (1 instance) - collapsible nested if into match guard (1 instance) Remaining warnings (intentionally skipped) involve signature changes (unnecessary_wraps), large enum refactoring (result_large_err), function splitting (too_many_lines), MSRV concerns (duration_suboptimal_units), or private-module method references (redundant_closure on runtime::json). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
clippy::pedanticfixes across 10 files in the workspacemap().unwrap_or()→map_or()/is_ok_and(),match_same_arms,collapsible_match,unnested_or_patterns,doc_markdown,useless_format,unnecessary_lazy_evaluations,redundant_closureFiles changed
crates/api/src/providers/anthropic.rs—map_or, collapsed nestedifinto match guardcrates/api/src/providers/openai_compat.rs—map_or, doc markdown, merged match armscrates/api/src/providers/mod.rs—map_orcrates/mock-anthropic-service/src/lib.rs— removed redundant match armcrates/plugins/src/hooks.rs— removed unused importcrates/runtime/src/compact.rs— merged match armscrates/runtime/src/hooks.rs— removed unnecessarymutcrates/runtime/src/sandbox.rs—is_ok_andcrates/tools/src/lib.rs—is_ok_and(×2)crates/rusty-claude-cli/src/main.rs— doc markdown,useless_format,unnecessary_lazy_evaluations,unnested_or_patterns,redundant_closure,is_ok_and(×3)Test plan
cargo check --workspacepasses🤖 Generated with Claude Code