From 5a960950f38a5001719b4ec41be944b93ce4c955 Mon Sep 17 00:00:00 2001 From: Andrei Eres Date: Mon, 25 Nov 2024 16:45:25 +0100 Subject: [PATCH] Fix clippy --- .../network/benches/request_response_protocol.rs | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/substrate/client/network/benches/request_response_protocol.rs b/substrate/client/network/benches/request_response_protocol.rs index 908eb89f4e04..85381112b753 100644 --- a/substrate/client/network/benches/request_response_protocol.rs +++ b/substrate/client/network/benches/request_response_protocol.rs @@ -186,12 +186,11 @@ where async fn run_serially(setup: Arc, 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(), @@ -202,19 +201,9 @@ async fn run_serially(setup: Arc, 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();