chore(test): use collect void realloc (#11669)

This commit is contained in:
nk_ysg
2024-10-12 00:27:24 +08:00
committed by GitHub
parent 6a56ae75b0
commit ad2a2f2101

View File

@ -1338,10 +1338,8 @@ impl MockTransactionDistribution {
nonce_range: Range<u64>,
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::<Vec<_>>();
MockTransactionSet::new(txs)
}