From 7f64f8dd331664ebe3fb779c09584b2333c05620 Mon Sep 17 00:00:00 2001 From: Derek Cofausper <256792747+decofe@users.noreply.github.com> Date: Mon, 13 Apr 2026 12:04:46 +0000 Subject: [PATCH] clippy: warn on type_repetition_in_bounds Co-Authored-By: zerosnacks <95942363+zerosnacks@users.noreply.github.com> --- Cargo.toml | 1 + crates/anvil/src/eth/backend/mem/mod.rs | 14 ++++++-------- crates/anvil/src/service.rs | 16 ++++++++-------- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ab8fd5e71937a..beb377dd920fb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -82,6 +82,7 @@ string_lit_chars_any = "warn" suboptimal_flops = "warn" suspicious_operation_groupings = "warn" transmute_undefined_repr = "warn" +type_repetition_in_bounds = "warn" uninhabited_references = "warn" uninlined_format_args = "warn" unnested_or_patterns = "warn" diff --git a/crates/anvil/src/eth/backend/mem/mod.rs b/crates/anvil/src/eth/backend/mem/mod.rs index 0f734e8f9b9ef..0d6fffd4f3979 100644 --- a/crates/anvil/src/eth/backend/mem/mod.rs +++ b/crates/anvil/src/eth/backend/mem/mod.rs @@ -2435,10 +2435,10 @@ where } // Mining methods — generic over N: Network, with Foundry-associated-type bounds for now. -impl Backend +impl> + Backend where Self: TransactionValidator, - N: Network, { /// Mines a new block and stores it. /// @@ -3341,9 +3341,8 @@ where } } -impl Backend -where - N: Network, +impl> + Backend { /// Rollback the chain to a common height. /// @@ -4064,9 +4063,8 @@ fn get_pool_transactions_nonce( } #[async_trait::async_trait] -impl TransactionValidator for Backend -where - N: Network, +impl> + TransactionValidator for Backend { async fn validate_pool_transaction( &self, diff --git a/crates/anvil/src/service.rs b/crates/anvil/src/service.rs index 88a47b55a1418..d98b1ddf176c3 100644 --- a/crates/anvil/src/service.rs +++ b/crates/anvil/src/service.rs @@ -47,10 +47,10 @@ where filter_eviction_interval: Interval, } -impl NodeService +impl> + NodeService where Backend: TransactionValidator, - N: Network, { pub fn new( pool: Arc>, @@ -72,10 +72,10 @@ where } } -impl Future for NodeService +impl> Future + for NodeService where Backend: TransactionValidator, - N: Network, { type Output = NodeResult<()>; @@ -128,20 +128,20 @@ struct BlockProducer { queued: VecDeque>>>, } -impl BlockProducer +impl> + BlockProducer where Backend: TransactionValidator, - N: Network, { fn new(backend: Arc>) -> Self { Self { idle_backend: Some(backend), block_mining: None, queued: Default::default() } } } -impl Stream for BlockProducer +impl + 'static> + Stream for BlockProducer where Backend: TransactionValidator + Send + Sync + 'static, - N: Network + 'static, { type Item = MinedBlockOutcome;