Skip to content

Commit 2e5a9a8

Browse files
committed
Clippy
1 parent e5b22ea commit 2e5a9a8

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

crates/networking/p2p/peer_channels.rs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -278,14 +278,13 @@ impl PeerHandler {
278278
.iter()
279279
.map(|acc| acc.encode_to_vec())
280280
.collect::<Vec<_>>();
281-
if let Some(should_continue) = verify_range(
281+
if let Ok(should_continue) = verify_range(
282282
state_root,
283283
&start,
284284
&account_hashes,
285285
&encoded_accounts,
286286
&proof,
287287
)
288-
.ok()
289288
{
290289
return Some((account_hashes, accounts, should_continue));
291290
}
@@ -420,12 +419,10 @@ impl PeerHandler {
420419
continue;
421420
};
422421
should_continue = sc;
423-
} else {
424-
if verify_range(storage_root, &start, &hahsed_keys, &encoded_values, &[])
425-
.is_err()
426-
{
427-
continue;
428-
}
422+
} else if verify_range(storage_root, &start, &hahsed_keys, &encoded_values, &[])
423+
.is_err()
424+
{
425+
continue;
429426
}
430427

431428
storage_keys.push(hahsed_keys);
@@ -521,7 +518,7 @@ impl PeerHandler {
521518
[
522519
vec![Bytes::from(acc_path.0.to_vec())],
523520
paths
524-
.into_iter()
521+
.iter()
525522
.map(|path| Bytes::from(path.encode_compact()))
526523
.collect(),
527524
]
@@ -630,8 +627,8 @@ impl PeerHandler {
630627
.map(|val| val.encode_to_vec())
631628
.collect::<Vec<_>>();
632629
// Verify storage range
633-
if let Some(should_continue) =
634-
verify_range(storage_root, &start, &storage_keys, &encoded_values, &proof).ok()
630+
if let Ok(should_continue) =
631+
verify_range(storage_root, &start, &storage_keys, &encoded_values, &proof)
635632
{
636633
return Some((storage_keys, storage_values, should_continue));
637634
}

crates/networking/p2p/sync.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ async fn fetch_bytecode_batch(
504504
}
505505
}
506506
// Return remaining code hashes in the batch if we couldn't fetch all of them
507-
return Ok(batch);
507+
Ok(batch)
508508
}
509509

510510
/// Waits for incoming account hashes & storage roots from the receiver channel endpoint, queues them, and fetches and stores their bytecodes in batches

0 commit comments

Comments
 (0)