From 1ef4d6d61b2f15358ec7f6e0760fd186e5ef5c0b Mon Sep 17 00:00:00 2001 From: Thomas Coratger <60488569+tcoratger@users.noreply.github.com> Date: Wed, 4 Sep 2024 15:07:26 -0700 Subject: [PATCH] clippy: add `collection_is_never_read` clippy lint (#10703) --- Cargo.toml | 2 +- crates/chainspec/src/spec.rs | 2 +- crates/rpc/rpc-testing-util/src/trace.rs | 6 ------ 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4d366ec19..edc82cbcd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -171,6 +171,7 @@ rustdoc.all = "warn" branches_sharing_code = "warn" clear_with_drain = "warn" cloned_instead_of_copied = "warn" +collection_is_never_read = "warn" derive_partial_eq_without_eq = "warn" doc_markdown = "warn" empty_line_after_doc_comments = "warn" @@ -231,7 +232,6 @@ zero_sized_map_values = "warn" # Explicitly listing should make it easier to fix in the future. as_ptr_cast_mut = "allow" cognitive_complexity = "allow" -collection_is_never_read = "allow" debug_assert_with_mut_call = "allow" fallible_impl_from = "allow" future_not_send = "allow" diff --git a/crates/chainspec/src/spec.rs b/crates/chainspec/src/spec.rs index 3135db04b..67506162d 100644 --- a/crates/chainspec/src/spec.rs +++ b/crates/chainspec/src/spec.rs @@ -695,7 +695,7 @@ impl From for ChainSpec { chain: genesis.config.chain_id.into(), genesis, genesis_hash: None, - hardforks: ChainHardforks::new(hardforks), + hardforks: ChainHardforks::new(ordered_hardforks), paris_block_and_final_difficulty, deposit_contract, #[cfg(feature = "optimism")] diff --git a/crates/rpc/rpc-testing-util/src/trace.rs b/crates/rpc/rpc-testing-util/src/trace.rs index db8933c0a..862ecb432 100644 --- a/crates/rpc/rpc-testing-util/src/trace.rs +++ b/crates/rpc/rpc-testing-util/src/trace.rs @@ -545,7 +545,6 @@ mod tests { let mut stream = client.replay_transactions(transactions, trace_types); let mut successes = 0; let mut failures = 0; - let mut all_results = Vec::new(); assert_is_stream(&stream); @@ -554,12 +553,10 @@ mod tests { Ok((trace_result, tx_hash)) => { println!("Success for tx_hash {tx_hash:?}: {trace_result:?}"); successes += 1; - all_results.push(Ok((trace_result, tx_hash))); } Err((error, tx_hash)) => { println!("Error for tx_hash {tx_hash:?}: {error:?}"); failures += 1; - all_results.push(Err((error, tx_hash))); } } } @@ -656,7 +653,6 @@ mod tests { let mut stream = client.trace_call_stream(trace_call_request); let mut successes = 0; let mut failures = 0; - let mut all_results = Vec::new(); assert_is_stream(&stream); @@ -665,12 +661,10 @@ mod tests { Ok(trace_result) => { println!("Success: {trace_result:?}"); successes += 1; - all_results.push(Ok(trace_result)); } Err((error, request)) => { println!("Error for request {request:?}: {error:?}"); failures += 1; - all_results.push(Err((error, request))); } } }