Skip to content

Commit 598246c

Browse files
authored
[workspace] clippy and fmt (#3644)
1 parent ad26141 commit 598246c

6 files changed

Lines changed: 11 additions & 26 deletions

File tree

consensus/src/marshal/core/actor.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -525,11 +525,7 @@ where
525525
response.send_lossy(info);
526526
}
527527
Message::GetVerified { round, response } => {
528-
let block = self
529-
.cache
530-
.get_verified(round)
531-
.await
532-
.map(Into::into);
528+
let block = self.cache.get_verified(round).await.map(Into::into);
533529
response.send_lossy(block);
534530
}
535531
Message::Forward {
@@ -559,7 +555,8 @@ where
559555
// `cache_verified` is a no-op because the round is below
560556
// the retention floor (and no longer is required by consensus
561557
// to make progress).
562-
self.cache_verified(round, block.digest(), block.clone()).await;
558+
self.cache_verified(round, block.digest(), block.clone())
559+
.await;
563560
// Retain the block in memory so the subsequent
564561
// `Forward` can broadcast it without reloading from
565562
// storage. An older retained proposal (if any) is
@@ -805,9 +802,7 @@ where
805802
}
806803

807804
// Batch verify and process all delivers.
808-
needs_sync |= self
809-
.verify_delivered(delivers, &mut application)
810-
.await;
805+
needs_sync |= self.verify_delivered(delivers, &mut application).await;
811806

812807
// Attempt to fill gaps before handling produce requests (so we
813808
// can serve data we just received).

consensus/src/simplex/actors/voter/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8717,9 +8717,7 @@ mod tests {
87178717
select! {
87188718
msg = batcher_receiver.recv() => match msg.unwrap() {
87198719
batcher::Message::Update {
8720-
current,
8721-
response,
8722-
..
8720+
current, response, ..
87238721
} if current > target_view => {
87248722
// Signal leader inactivity to trigger the timeout path.
87258723
response.send(Some(TimeoutReason::Inactivity)).unwrap();

p2p/src/lib.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -346,11 +346,7 @@ stability_scope!(BETA {
346346
/// "follow that progress" (but not contribute to it). We call the former "primary" and the latter "secondary".
347347
/// When both are tracked, mechanisms favor "primary" peers but continue to replicate data to "secondary" peers (
348348
/// often both gossiping data to them and answering requests from them).
349-
fn track<R>(
350-
&mut self,
351-
id: u64,
352-
peers: R,
353-
) -> impl Future<Output = ()> + Send
349+
fn track<R>(&mut self, id: u64, peers: R) -> impl Future<Output = ()> + Send
354350
where
355351
R: Into<TrackedPeers<Self::PublicKey>> + Send;
356352
}
@@ -382,11 +378,7 @@ stability_scope!(BETA {
382378
/// "follow that progress" (but not contribute to it). We call the former "primary" and the latter "secondary".
383379
/// When both are tracked, mechanisms favor "primary" peers but continue to replicate data to "secondary" peers (
384380
/// often both gossiping data to them and answering requests from them).
385-
fn track<R>(
386-
&mut self,
387-
id: u64,
388-
peers: R,
389-
) -> impl Future<Output = ()> + Send
381+
fn track<R>(&mut self, id: u64, peers: R) -> impl Future<Output = ()> + Send
390382
where
391383
R: Into<AddressableTrackedPeers<Self::PublicKey>> + Send;
392384

resolver/src/p2p/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ mod tests {
496496
event = cons_out1.recv() => {
497497
panic!("fetch should wait for the initial peer set, got {event:?}");
498498
},
499-
_ = context.sleep(Duration::from_millis(200)) => {}
499+
_ = context.sleep(Duration::from_millis(200)) => {},
500500
};
501501

502502
oracle

storage/src/qmdb/any/batch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1688,7 +1688,7 @@ mod tests {
16881688
},
16891689
),
16901690
];
1691-
base_diff.sort_by(|a, b| a.0.cmp(&b.0));
1691+
base_diff.sort_by_key(|a| a.0);
16921692

16931693
let creates = extract_parent_deleted_creates(&mut mutations, &base_diff);
16941694

storage/src/qmdb/immutable/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,12 +1253,12 @@ pub(super) mod test {
12531253
let mut kvs_first: Vec<(Digest, Digest)> = (0u64..5)
12541254
.map(|i| (Sha256::hash(&i.to_be_bytes()), Sha256::fill(i as u8)))
12551255
.collect();
1256-
kvs_first.sort_by(|a, b| a.0.cmp(&b.0));
1256+
kvs_first.sort_by_key(|a| a.0);
12571257

12581258
let mut kvs_second: Vec<(Digest, Digest)> = (5u64..10)
12591259
.map(|i| (Sha256::hash(&i.to_be_bytes()), Sha256::fill(i as u8)))
12601260
.collect();
1261-
kvs_second.sort_by(|a, b| a.0.cmp(&b.0));
1261+
kvs_second.sort_by_key(|a| a.0);
12621262

12631263
// Parent batch: set keys 0..5.
12641264
let mut parent = db.new_batch();

0 commit comments

Comments
 (0)