diff --git a/gossip/benches/weighted_shuffle.rs b/gossip/benches/weighted_shuffle.rs index 09615c57bbca15..3dcf3d236473c4 100644 --- a/gossip/benches/weighted_shuffle.rs +++ b/gossip/benches/weighted_shuffle.rs @@ -32,7 +32,11 @@ fn bench_weighted_shuffle_shuffle(bencher: &mut Bencher) { bencher.iter(|| { rng.fill(&mut seed[..]); let mut rng = ChaChaRng::from_seed(seed); - let shuffle = weighted_shuffle.clone().shuffle(&mut rng); - std::hint::black_box(shuffle.collect::>()); + weighted_shuffle + .clone() + .shuffle(&mut rng) + .for_each(|index| { + std::hint::black_box(index); + }); }); }