Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/anvil/tests/it/anvil_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ async fn can_mine_manually() {

let start_num = provider.get_block_number().await.unwrap();

for (idx, _) in std::iter::repeat(()).take(10).enumerate() {
for (idx, _) in std::iter::repeat_n((), 10).enumerate() {
api.evm_mine(None).await.unwrap();
let num = provider.get_block_number().await.unwrap();
assert_eq!(num, start_num + idx as u64 + 1);
Expand Down
3 changes: 1 addition & 2 deletions crates/anvil/tests/it/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -897,8 +897,7 @@ async fn can_stream_pending_transactions() {
TransactionRequest::default().from(accounts[0]).to(accounts[0]).value(U256::from(1e18));

let mut sending = futures::future::join_all(
std::iter::repeat(tx.clone())
.take(num_txs)
std::iter::repeat_n(tx.clone(), num_txs)
.enumerate()
.map(|(nonce, tx)| tx.nonce(nonce as u64))
.map(|tx| async {
Expand Down
2 changes: 1 addition & 1 deletion crates/common/fmt/src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ impl UIfmt for OtherFields {
let val = EthValue::from(value.clone()).pretty();
let offset = NAME_COLUMN_LEN.saturating_sub(key.len());
s.push_str(key);
s.extend(std::iter::repeat(' ').take(offset + 1));
s.extend(std::iter::repeat_n(' ', offset + 1));
s.push_str(&val);
s.push('\n');
}
Expand Down
2 changes: 1 addition & 1 deletion crates/fmt/src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl<W> FormatBuffer<W> {

/// Indent the buffer by delta
pub fn indent(&mut self, delta: usize) {
self.indents.extend(std::iter::repeat(IndentGroup::default()).take(delta));
self.indents.extend(std::iter::repeat_n(IndentGroup::default(), delta));
}

/// Dedent the buffer by delta
Expand Down
2 changes: 1 addition & 1 deletion crates/forge/src/coverage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ impl CoverageReporter for LcovReporter {
}
// Statements are not in the LCOV format.
// We don't add them in order to avoid doubling line hits.
CoverageItemKind::Statement { .. } => {}
CoverageItemKind::Statement => {}
}
}

Expand Down
7 changes: 5 additions & 2 deletions crates/wallets/src/multi_wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use derive_builder::Builder;
use eyre::Result;
use foundry_config::Config;
use serde::Serialize;
use std::{iter::repeat, path::PathBuf};
use std::path::PathBuf;

/// Container for multiple wallets.
#[derive(Debug, Default)]
Expand Down Expand Up @@ -249,7 +249,10 @@ impl MultiWalletOpts {
signers.extend(mnemonics);
}
if self.interactives > 0 {
pending.extend(repeat(PendingSigner::Interactive).take(self.interactives as usize));
pending.extend(std::iter::repeat_n(
PendingSigner::Interactive,
self.interactives as usize,
));
}

Ok(MultiWallet::new(pending, signers))
Expand Down