Skip to content

Commit

Permalink
Fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiEres committed Nov 25, 2024
1 parent 763ce3e commit 5a96095
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions substrate/client/network/benches/request_response_protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,11 @@ where

async fn run_serially(setup: Arc<BenchSetup>, size: usize, limit: usize) {
let (break_tx, break_rx) = async_channel::bounded(1);
let requests = {
let network1 = tokio::spawn({
let network_service1 = Arc::clone(&setup.network_service1);
let peer_id2 = setup.peer_id2;
async move {
let mut sent_counter = 0;
while sent_counter < limit {
for _ in 0..limit {
let _ = network_service1
.request(
peer_id2.into(),
Expand All @@ -202,19 +201,9 @@ async fn run_serially(setup: Arc<BenchSetup>, size: usize, limit: usize) {
)
.await
.unwrap();
sent_counter += 1;
}
let _ = break_tx.send(()).await;
}
};

let network1 = tokio::spawn(async move {
tokio::pin!(requests);
loop {
tokio::select! {
_ = &mut requests => break,
}
}
});
let network2 = tokio::spawn({
let rx2 = setup.rx2.clone();
Expand Down

0 comments on commit 5a96095

Please sign in to comment.