clippy: add collection_is_never_read clippy lint (#10703)

This commit is contained in:
Thomas Coratger
2024-09-04 15:07:26 -07:00
committed by GitHub
parent f8e5b181bb
commit 1ef4d6d61b
3 changed files with 2 additions and 8 deletions

View File

@ -171,6 +171,7 @@ rustdoc.all = "warn"
branches_sharing_code = "warn" branches_sharing_code = "warn"
clear_with_drain = "warn" clear_with_drain = "warn"
cloned_instead_of_copied = "warn" cloned_instead_of_copied = "warn"
collection_is_never_read = "warn"
derive_partial_eq_without_eq = "warn" derive_partial_eq_without_eq = "warn"
doc_markdown = "warn" doc_markdown = "warn"
empty_line_after_doc_comments = "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. # Explicitly listing should make it easier to fix in the future.
as_ptr_cast_mut = "allow" as_ptr_cast_mut = "allow"
cognitive_complexity = "allow" cognitive_complexity = "allow"
collection_is_never_read = "allow"
debug_assert_with_mut_call = "allow" debug_assert_with_mut_call = "allow"
fallible_impl_from = "allow" fallible_impl_from = "allow"
future_not_send = "allow" future_not_send = "allow"

View File

@ -695,7 +695,7 @@ impl From<Genesis> for ChainSpec {
chain: genesis.config.chain_id.into(), chain: genesis.config.chain_id.into(),
genesis, genesis,
genesis_hash: None, genesis_hash: None,
hardforks: ChainHardforks::new(hardforks), hardforks: ChainHardforks::new(ordered_hardforks),
paris_block_and_final_difficulty, paris_block_and_final_difficulty,
deposit_contract, deposit_contract,
#[cfg(feature = "optimism")] #[cfg(feature = "optimism")]

View File

@ -545,7 +545,6 @@ mod tests {
let mut stream = client.replay_transactions(transactions, trace_types); let mut stream = client.replay_transactions(transactions, trace_types);
let mut successes = 0; let mut successes = 0;
let mut failures = 0; let mut failures = 0;
let mut all_results = Vec::new();
assert_is_stream(&stream); assert_is_stream(&stream);
@ -554,12 +553,10 @@ mod tests {
Ok((trace_result, tx_hash)) => { Ok((trace_result, tx_hash)) => {
println!("Success for tx_hash {tx_hash:?}: {trace_result:?}"); println!("Success for tx_hash {tx_hash:?}: {trace_result:?}");
successes += 1; successes += 1;
all_results.push(Ok((trace_result, tx_hash)));
} }
Err((error, tx_hash)) => { Err((error, tx_hash)) => {
println!("Error for tx_hash {tx_hash:?}: {error:?}"); println!("Error for tx_hash {tx_hash:?}: {error:?}");
failures += 1; 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 stream = client.trace_call_stream(trace_call_request);
let mut successes = 0; let mut successes = 0;
let mut failures = 0; let mut failures = 0;
let mut all_results = Vec::new();
assert_is_stream(&stream); assert_is_stream(&stream);
@ -665,12 +661,10 @@ mod tests {
Ok(trace_result) => { Ok(trace_result) => {
println!("Success: {trace_result:?}"); println!("Success: {trace_result:?}");
successes += 1; successes += 1;
all_results.push(Ok(trace_result));
} }
Err((error, request)) => { Err((error, request)) => {
println!("Error for request {request:?}: {error:?}"); println!("Error for request {request:?}: {error:?}");
failures += 1; failures += 1;
all_results.push(Err((error, request)));
} }
} }
} }