Skip to content

Commit d2b4ab5

Browse files
authored
chore: fix nightly clippy warnings (#23923)
1 parent ddb3819 commit d2b4ab5

5 files changed

Lines changed: 11 additions & 11 deletions

File tree

crates/cli/commands/src/test_vectors/compact.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ where
194194
T: for<'a> Arbitrary<'a> + reth_codecs::Compact,
195195
{
196196
let type_name = type_name::<T>();
197-
print!("{}", &type_name);
197+
print!("{}", type_name);
198198

199199
let mut bytes = std::iter::repeat_n(0u8, 256).collect::<Vec<u8>>();
200200
let mut compact_buffer = vec![];
@@ -230,7 +230,7 @@ where
230230

231231
serde_json::to_writer(
232232
std::io::BufWriter::new(
233-
std::fs::File::create(format!("{VECTORS_FOLDER}/{}.json", &type_name)).unwrap(),
233+
std::fs::File::create(format!("{VECTORS_FOLDER}/{}.json", type_name)).unwrap(),
234234
),
235235
&values,
236236
)?;
@@ -247,10 +247,10 @@ where
247247
T: reth_codecs::Compact,
248248
{
249249
let type_name = type_name::<T>();
250-
print!("{}", &type_name);
250+
print!("{}", type_name);
251251

252252
// Read the file where the vectors are stored
253-
let file_path = format!("{VECTORS_FOLDER}/{}.json", &type_name);
253+
let file_path = format!("{VECTORS_FOLDER}/{}.json", type_name);
254254
let file =
255255
File::open(&file_path).wrap_err_with(|| format!("Failed to open vector {type_name}."))?;
256256
let reader = BufReader::new(file);

crates/consensus/debug-client/src/providers/etherscan.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ where
5555
block_number_or_tag: BlockNumberOrTag,
5656
) -> eyre::Result<PrimitiveBlock> {
5757
let tag = match block_number_or_tag {
58-
BlockNumberOrTag::Number(num) => format!("{num:#02x}"),
58+
BlockNumberOrTag::Number(num) => format!("{num:#x}"),
5959
tag => tag.to_string(),
6060
};
6161

crates/storage/provider/src/test_utils/mock.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ impl<T: NodePrimitives, ChainSpec: EthChainSpec + 'static> TransactionsProvider
441441
) -> ProviderResult<Vec<Vec<Self::Transaction>>> {
442442
// init btreemap so we can return in order
443443
let mut map = BTreeMap::new();
444-
for (_, block) in self.blocks.lock().iter() {
444+
for block in self.blocks.lock().values() {
445445
if range.contains(&block.header().number()) {
446446
map.insert(block.header().number(), block.body().clone_transactions());
447447
}

crates/transaction-pool/src/blobstore/mem.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ impl InMemoryBlobStore {
2525
) -> Vec<Option<BlobAndProofV2>> {
2626
let mut result = vec![None; versioned_hashes.len()];
2727
let mut missing_count = result.len();
28-
for (_tx_hash, blob_sidecar) in self.inner.store.read().iter() {
28+
for blob_sidecar in self.inner.store.read().values() {
2929
if let Some(blob_sidecar) = blob_sidecar.as_eip7594() {
3030
for (hash_idx, match_result) in
3131
blob_sidecar.match_versioned_hashes(versioned_hashes)
@@ -181,7 +181,7 @@ impl BlobStore for InMemoryBlobStore {
181181
versioned_hashes: &[B256],
182182
) -> Result<Vec<Option<BlobAndProofV1>>, BlobStoreError> {
183183
let mut result = vec![None; versioned_hashes.len()];
184-
for (_tx_hash, blob_sidecar) in self.inner.store.read().iter() {
184+
for blob_sidecar in self.inner.store.read().values() {
185185
if let Some(blob_sidecar) = blob_sidecar.as_eip4844() {
186186
for (hash_idx, match_result) in
187187
blob_sidecar.match_versioned_hashes(versioned_hashes)

examples/beacon-api-sidecar-fetcher/src/mined_sidecar.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,13 @@ where
188188
{
189189
match notification {
190190
CanonStateNotification::Commit { new } => {
191-
for (_, block) in new.blocks().iter() {
191+
for block in new.blocks().values() {
192192
this.process_block(block);
193193
}
194194
}
195195
CanonStateNotification::Reorg { old, new } => {
196196
// handle reorged blocks
197-
for (_, block) in old.blocks().iter() {
197+
for block in old.blocks().values() {
198198
let txs: Vec<BlobTransactionEvent> = block
199199
.body()
200200
.transactions()
@@ -215,7 +215,7 @@ where
215215
this.queued_actions.extend(txs);
216216
}
217217

218-
for (_, block) in new.blocks().iter() {
218+
for block in new.blocks().values() {
219219
this.process_block(block);
220220
}
221221
}

0 commit comments

Comments
 (0)