diff --git a/core/benches/types/concurrent_tasks.rs b/core/benches/types/concurrent_tasks.rs index 4f4274e2cb55..3e0948541612 100644 --- a/core/benches/types/concurrent_tasks.rs +++ b/core/benches/types/concurrent_tasks.rs @@ -30,30 +30,34 @@ pub fn bench_concurrent_tasks(c: &mut Criterion) { let mut group = c.benchmark_group("bench_concurrent_tasks"); for concurrent in [1, 2, 4, 8, 16] { - group.bench_with_input(format!("concurrent {}",concurrent), &concurrent, |b, concurrent| { - b.to_async(&*TOKIO).iter_batched( - || { - ConcurrentTasks::new(Executor::new(), *concurrent, |()| { - Box::pin(async { - tokio::time::sleep(Duration::from_millis(1)).await; - ((), Ok(())) + group.bench_with_input( + format!("concurrent {}", concurrent), + &concurrent, + |b, concurrent| { + b.to_async(&*TOKIO).iter_batched( + || { + ConcurrentTasks::new(Executor::new(), *concurrent, |()| { + Box::pin(async { + tokio::time::sleep(Duration::from_millis(1)).await; + ((), Ok(())) + }) }) - }) - }, - |mut tasks| async move { - for _ in 0..100 { - let _ = tasks.execute(()).await; - } + }, + |mut tasks| async move { + for _ in 0..100 { + let _ = tasks.execute(()).await; + } - loop { - if tasks.next().await.is_none() { - break; + loop { + if tasks.next().await.is_none() { + break; + } } - } - }, - BatchSize::PerIteration, - ) - }); + }, + BatchSize::PerIteration, + ) + }, + ); } group.finish()