Skip to content

Commit 9e101df

Browse files
committed
fmt and clippy
1 parent 787532f commit 9e101df

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

crates/engine/tree/src/tree/payload_processor/multiproof.rs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,12 +1016,12 @@ impl MultiProofTask {
10161016
accumulated_targets.push(targets);
10171017

10181018
// Fast-path dispatch if the first message already fills the batch.
1019-
if accumulated_count < PREFETCH_MAX_BATCH_TARGETS
1020-
&& accumulated_targets.len() < PREFETCH_MAX_BATCH_MESSAGES
1019+
if accumulated_count < PREFETCH_MAX_BATCH_TARGETS &&
1020+
accumulated_targets.len() < PREFETCH_MAX_BATCH_MESSAGES
10211021
{
10221022
loop {
1023-
if accumulated_count >= PREFETCH_MAX_BATCH_TARGETS
1024-
|| accumulated_targets.len() >= PREFETCH_MAX_BATCH_MESSAGES
1023+
if accumulated_count >= PREFETCH_MAX_BATCH_TARGETS ||
1024+
accumulated_targets.len() >= PREFETCH_MAX_BATCH_MESSAGES
10251025
{
10261026
break;
10271027
}
@@ -1454,8 +1454,8 @@ fn get_proof_targets(
14541454
.storage
14551455
.keys()
14561456
.filter(|slot| {
1457-
!fetched.is_some_and(|f| f.contains(*slot))
1458-
|| storage_added_removed_keys.is_some_and(|k| k.is_removed(slot))
1457+
!fetched.is_some_and(|f| f.contains(*slot)) ||
1458+
storage_added_removed_keys.is_some_and(|k| k.is_removed(slot))
14591459
})
14601460
.peekable();
14611461

@@ -1488,13 +1488,13 @@ fn dispatch_with_chunking<T, I>(
14881488
where
14891489
I: IntoIterator<Item = T>,
14901490
{
1491-
let should_chunk = chunking_len > max_targets_for_chunking
1492-
|| available_account_workers > 1
1493-
|| available_storage_workers > 1;
1491+
let should_chunk = chunking_len > max_targets_for_chunking ||
1492+
available_account_workers > 1 ||
1493+
available_storage_workers > 1;
14941494

1495-
if should_chunk
1496-
&& let Some(chunk_size) = chunk_size
1497-
&& chunking_len > chunk_size
1495+
if should_chunk &&
1496+
let Some(chunk_size) = chunk_size &&
1497+
chunking_len > chunk_size
14981498
{
14991499
let mut dispatched = 0usize;
15001500
for chunk in chunker(items, chunk_size) {
@@ -1523,8 +1523,8 @@ fn can_batch_state_update(
15231523
}
15241524

15251525
match (batch_source, next_source) {
1526-
(StateChangeSource::PreBlock(_), StateChangeSource::PreBlock(_))
1527-
| (StateChangeSource::PostBlock(_), StateChangeSource::PostBlock(_)) => {
1526+
(StateChangeSource::PreBlock(_), StateChangeSource::PreBlock(_)) |
1527+
(StateChangeSource::PostBlock(_), StateChangeSource::PostBlock(_)) => {
15281528
batch_update == next_update
15291529
}
15301530
_ => true,
@@ -2248,8 +2248,8 @@ mod tests {
22482248
}
22492249
match task.rx.try_recv() {
22502250
Ok(MultiProofMessage::StateUpdate(next_source, next_update)) => {
2251-
if let Some((batch_source, batch_update)) = accumulated_updates.first()
2252-
&& !can_batch_state_update(
2251+
if let Some((batch_source, batch_update)) = accumulated_updates.first() &&
2252+
!can_batch_state_update(
22532253
*batch_source,
22542254
batch_update,
22552255
next_source,
@@ -2267,8 +2267,8 @@ mod tests {
22672267
Some(MultiProofMessage::StateUpdate(next_source, next_update));
22682268
break;
22692269
}
2270-
if accumulated_targets + next_estimate > STATE_UPDATE_MAX_BATCH_TARGETS
2271-
&& !accumulated_updates.is_empty()
2270+
if accumulated_targets + next_estimate > STATE_UPDATE_MAX_BATCH_TARGETS &&
2271+
!accumulated_updates.is_empty()
22722272
{
22732273
pending_msg =
22742274
Some(MultiProofMessage::StateUpdate(next_source, next_update));
@@ -2370,8 +2370,8 @@ mod tests {
23702370
}
23712371
match task.rx.try_recv() {
23722372
Ok(MultiProofMessage::StateUpdate(next_source, next_update)) => {
2373-
if let Some((batch_source, batch_update)) = accumulated_updates.first()
2374-
&& !can_batch_state_update(
2373+
if let Some((batch_source, batch_update)) = accumulated_updates.first() &&
2374+
!can_batch_state_update(
23752375
*batch_source,
23762376
batch_update,
23772377
next_source,
@@ -2389,8 +2389,8 @@ mod tests {
23892389
Some(MultiProofMessage::StateUpdate(next_source, next_update));
23902390
break;
23912391
}
2392-
if accumulated_targets + next_estimate > STATE_UPDATE_MAX_BATCH_TARGETS
2393-
&& !accumulated_updates.is_empty()
2392+
if accumulated_targets + next_estimate > STATE_UPDATE_MAX_BATCH_TARGETS &&
2393+
!accumulated_updates.is_empty()
23942394
{
23952395
pending_msg =
23962396
Some(MultiProofMessage::StateUpdate(next_source, next_update));

0 commit comments

Comments
 (0)