diff --git a/crates/transaction-pool/src/test_utils/mock.rs b/crates/transaction-pool/src/test_utils/mock.rs index 6b470bb6fb..e2b5f373e4 100644 --- a/crates/transaction-pool/src/test_utils/mock.rs +++ b/crates/transaction-pool/src/test_utils/mock.rs @@ -1338,10 +1338,8 @@ impl MockTransactionDistribution { nonce_range: Range, rng: &mut impl rand::Rng, ) -> MockTransactionSet { - let mut txs = Vec::new(); - for nonce in nonce_range { - txs.push(self.tx(nonce, rng).with_sender(sender)); - } + let txs = + nonce_range.map(|nonce| self.tx(nonce, rng).with_sender(sender)).collect::>(); MockTransactionSet::new(txs) }