fix: resolve clippy warnings across workspace#3933
Merged
Conversation
Fix all clippy warnings in the workspace while maintaining proper suppression for third-party code. ## Changes - Fix `empty_line_after_doc_comments` warnings (3 occurrences) - Fix `manual_is_multiple_of` warnings (9 occurrences) - Fix `unwrap_or_default` warning (1 occurrence) - Fix `doc_overindented_list_items` warnings (5 occurrences) - Fix `non_canonical_partial_ord_impl` warning (1 occurrence) - Fix `unnecessary_unwrap` warnings (2 occurrences) - Fix `double_ended_iterator_last` warning (1 occurrence) - Fix `useless_conversion` warning (1 occurrence) - Add per-crate suppression for third_party warnings - Update Makefile `rust-clippy` target ## Testing - `make rust-clippy` - No warnings in project code - `make quick-check` - Successful compilation Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR resolves all clippy warnings in the workspace by applying idiomatic Rust patterns and properly suppressing third-party warnings at the crate level.
Changes:
- Applied 23 clippy fixes across 10 files, including empty line removal, use of
is_multiple_of(),unwrap_or_default(), proper doc indentation, canonicalPartialOrdimplementation,if letpatterns, and double-ended iterator optimization - Added crate-level suppression for third-party warnings in
move-borrow-graph - Updated Makefile to remove workspace-level clippy suppressions that are no longer needed
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Makefile | Removed unnecessary -A flags for clippy warnings now fixed in code |
| third_party/move/language/move-borrow-graph/src/lib.rs | Added crate-level allow attribute for third-party warnings |
| moveos/metrics/src/metered_channel.rs | Removed 3 blank lines after doc comments |
| moveos/metrics/src/metrics_util.rs | Replaced % with is_multiple_of() for cleaner modulo check |
| moveos/smt/src/lib.rs | Removed blank line after doc comment |
| moveos/smt/src/jellyfish_merkle/hash.rs | Replaced % with is_multiple_of() |
| moveos/smt/src/jellyfish_merkle/iterator/mod.rs | Replaced unwrap_or(zero()) with unwrap_or_default() |
| moveos/smt/src/jellyfish_merkle/nibble_path/mod.rs | Replaced % with is_multiple_of() in 3 locations |
| moveos/smt/src/jellyfish_merkle/node_type/mod.rs | Fixed doc indentation and replaced % with is_multiple_of() |
| moveos/smt/src/jellyfish_merkle/tree_cache/mod.rs | Fixed doc indentation for list items |
| moveos/smt/src/smt_object.rs | Fixed PartialOrd to use Ord::cmp() for canonical implementation |
| crates/rooch/src/commands/statedb/commands/export.rs | Replaced % with is_multiple_of() in 4 progress check locations |
| crates/rooch/src/commands/statedb/commands/genesis_verify.rs | Applied 7 fixes: is_multiple_of() (4×), if let unwrap patterns (2×), next_back() for iterator, and removed useless type conversion |
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
Fix all clippy warnings in the workspace while maintaining proper suppression for third-party code.
Changes
empty_line_after_doc_commentswarnings (3 occurrences)manual_is_multiple_ofwarnings (9 occurrences)unwrap_or_defaultwarning (1 occurrence)doc_overindented_list_itemswarnings (5 occurrences)non_canonical_partial_ord_implwarning (1 occurrence)unnecessary_unwrapwarnings (2 occurrences)double_ended_iterator_lastwarning (1 occurrence)useless_conversionwarning (1 occurrence)rust-clippytargetFiles Modified
Configuration
Makefile- Update rust-clippy target to remove unnecessary-Aflagsthird_party/move/language/move-borrow-graph/src/lib.rs- Add crate-level allow for third-party warningsSource Files (moveos/metrics)
moveos/metrics/src/metered_channel.rs- Remove blank lines after doc commentsmoveos/metrics/src/metrics_util.rs- Useis_multiple_of()Source Files (moveos/smt)
moveos/smt/src/lib.rs- Remove blank line after doc commentmoveos/smt/src/jellyfish_merkle/hash.rs- Useis_multiple_of()moveos/smt/src/jellyfish_merkle/iterator/mod.rs- Useunwrap_or_default()moveos/smt/src/jellyfish_merkle/nibble_path/mod.rs- Useis_multiple_of()moveos/smt/src/jellyfish_merkle/node_type/mod.rs- Fix doc indentation, useis_multiple_of()moveos/smt/src/jellyfish_merkle/tree_cache/mod.rs- Fix doc indentationmoveos/smt/src/smt_object.rs- Fix PartialOrd implementationSource Files (crates/rooch)
crates/rooch/src/commands/statedb/commands/export.rs- Useis_multiple_of()(4 occurrences)crates/rooch/src/commands/statedb/commands/genesis_verify.rs- Multiple fixes (16 warnings)Testing
make rust-clippy- No warnings in project codemake quick-check- Successful compilationTest Plan
make rust-clippy- verify clean output for project codemake build- verify compilation succeedsmake test- verify all tests pass (if applicable)