Resolve all Clippy warnings for idiomatic Rust#51
Merged
Conversation
Clippy warnings indicate deviations from Rust idioms and best practices. Resolving them improves code quality, prevents subtle bugs (e.g., double indirection via &Box<dyn Trait>), and keeps the codebase maintainable as it grows. Changes by category: Phase 1 - Mechanical fixes: - Add Default trait impls for ChangeSet, LocalEnv, ScopeManager - Remove redundant let binding in rbs/loader.rs (clippy::let_and_return) Phase 2 - Remove #[allow(dead_code)] annotations: - Remove blanket #[allow(dead_code)] from all structs, enums, traits, and impl blocks across 10 files (types.rs, scope.rs, box.rs, etc.) Phase 3 - API refinements: - Change BoxManager::get() return from &Box<dyn BoxTrait> to &dyn BoxTrait to eliminate unnecessary double indirection (clippy::borrowed_box) - Bundle 9 parameters of process_method_call_common into MethodCallContext struct to fix clippy::too_many_arguments - Replace redundant closure with function pointer in LspService::new (clippy::redundant_closure) - Change &PathBuf to &Path in CLI command signatures (clippy::ptr_arg) 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
Defaulttrait impls forChangeSet,LocalEnv,ScopeManager; remove redundantletbinding inrbs/loader.rs#[allow(dead_code)]annotations across 10 files, confirming all annotated code is actually used&Box<dyn BoxTrait>→&dyn BoxTrait(double indirection), bundle 9-param function intoMethodCallContextstruct (too_many_arguments), replace redundant closure with function pointer,&PathBuf→&PathTest plan
cd rust && cargo test --lib— all existing tests passcd rust && cargo clippy --lib --all-features -- -W clippy::all— zero warningstest_local_env_default,test_scope_manager_default,test_change_set_default🤖 Generated with Claude Code