chore: fix clippy lints on rust 1.95 - #113
Open
MavenRain wants to merge 1 commit into
Open
Conversation
Stable clippy 1.95 rejects two spots in the prioritized order pool with
`-D warnings`, which turns the Clippy CI jobs red for every PR:
- `clippy::manual_checked_ops` on the effective gas price computation
(`if total_gas_limit != 0 { a / b } else { 0 }`); use `checked_div`.
- `clippy::useless_conversion` on `extend(orders.into_iter())`; pass the
set directly.
No behaviour change.
Signed-off-by: Onyeka Obi <softwareengineerasaservant@isurvivable.cv>
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Refactors a couple of small code paths in the prioritized order pool to make them more idiomatic and slightly simpler, without changing behavior.
Changes:
- Simplified effective gas price computation using
checked_div(...).unwrap_or(0). - Simplified
extend(...)usage by removing a redundantinto_iter().
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| crates/pipeline/src/orderpool2/prioritized_pool/step.rs | Computes effective gas price via checked_div to avoid explicit zero-division branching. |
| crates/pipeline/src/orderpool2/prioritized_pool/mod.rs | Removes redundant iterator conversion when extending invalidated_orders. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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
Two one-line fixes so the Clippy CI jobs (
--all-targets --all-features -- -D warningsand the--no-default-featuresvariant) pass again on the current stable toolchain (rust 1.95):clippy::manual_checked_opsinorderpool2/prioritized_pool/step.rsandclippy::useless_conversioninorderpool2/prioritized_pool/mod.rs. Same spirit as #100 and #104.No behaviour change.
Note on CI
Unrelated to this change, a fresh
Cargo.locknow resolvesalloy-*to 1.8.x, which conflicts withop-alloy-network 0.23.1(E0119: conflicting implementations of NetworkWallet<Optimism> for EthereumWallet). Locally I pinned the alloy family to 1.7.3 to build; the proper fix is a dependency bump and is out of scope here, but it means the Clippy/Test jobs may still fail at lock resolution until that is addressed.