From a23432510ee38889a33df4b0eb6e02117ad5526b Mon Sep 17 00:00:00 2001 From: Onyeka Obi Date: Tue, 18 Aug 2026 15:07:01 -0700 Subject: [PATCH] chore: fix clippy lints on rust 1.95 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 --- crates/pipeline/src/orderpool2/prioritized_pool/mod.rs | 2 +- crates/pipeline/src/orderpool2/prioritized_pool/step.rs | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/crates/pipeline/src/orderpool2/prioritized_pool/mod.rs b/crates/pipeline/src/orderpool2/prioritized_pool/mod.rs index c679fd5..f8d85f0 100644 --- a/crates/pipeline/src/orderpool2/prioritized_pool/mod.rs +++ b/crates/pipeline/src/orderpool2/prioritized_pool/mod.rs @@ -112,7 +112,7 @@ where .insert(new_nonce.account, new_nonce.nonce); if let Some(orders) = self.main_queue_nonces.remove(&new_nonce.account) { - invalidated_orders.extend(orders.into_iter()); + invalidated_orders.extend(orders); } } diff --git a/crates/pipeline/src/orderpool2/prioritized_pool/step.rs b/crates/pipeline/src/orderpool2/prioritized_pool/step.rs index 5072d50..7d1ca3b 100644 --- a/crates/pipeline/src/orderpool2/prioritized_pool/step.rs +++ b/crates/pipeline/src/orderpool2/prioritized_pool/step.rs @@ -161,11 +161,9 @@ impl, P: Send + Sync + Platform> accumulated_weighted_fee += max_fee * gas_limit; total_gas_limit += gas_limit; } - let effective_gas_price = if total_gas_limit != 0 { - accumulated_weighted_fee / total_gas_limit - } else { - 0 - }; + let effective_gas_price = accumulated_weighted_fee + .checked_div(total_gas_limit) + .unwrap_or(0); Self { effective_gas_price, marker: PhantomData,