Skip to content

Commit 1904216

Browse files
authored
chore: fix clippy (#9790)
1 parent 9f11e6d commit 1904216

File tree

6 files changed

+10
-8
lines changed

6 files changed

+10
-8
lines changed

crates/anvil/tests/it/anvil_api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ async fn can_mine_manually() {
284284

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

287-
for (idx, _) in std::iter::repeat(()).take(10).enumerate() {
287+
for (idx, _) in std::iter::repeat_n((), 10).enumerate() {
288288
api.evm_mine(None).await.unwrap();
289289
let num = provider.get_block_number().await.unwrap();
290290
assert_eq!(num, start_num + idx as u64 + 1);

crates/anvil/tests/it/transaction.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -897,8 +897,7 @@ async fn can_stream_pending_transactions() {
897897
TransactionRequest::default().from(accounts[0]).to(accounts[0]).value(U256::from(1e18));
898898

899899
let mut sending = futures::future::join_all(
900-
std::iter::repeat(tx.clone())
901-
.take(num_txs)
900+
std::iter::repeat_n(tx.clone(), num_txs)
902901
.enumerate()
903902
.map(|(nonce, tx)| tx.nonce(nonce as u64))
904903
.map(|tx| async {

crates/common/fmt/src/ui.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ impl UIfmt for OtherFields {
301301
let val = EthValue::from(value.clone()).pretty();
302302
let offset = NAME_COLUMN_LEN.saturating_sub(key.len());
303303
s.push_str(key);
304-
s.extend(std::iter::repeat(' ').take(offset + 1));
304+
s.extend(std::iter::repeat_n(' ', offset + 1));
305305
s.push_str(&val);
306306
s.push('\n');
307307
}

crates/fmt/src/buffer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ impl<W> FormatBuffer<W> {
8888

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

9494
/// Dedent the buffer by delta

crates/forge/src/coverage.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ impl CoverageReporter for LcovReporter {
152152
}
153153
// Statements are not in the LCOV format.
154154
// We don't add them in order to avoid doubling line hits.
155-
CoverageItemKind::Statement { .. } => {}
155+
CoverageItemKind::Statement => {}
156156
}
157157
}
158158

crates/wallets/src/multi_wallet.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use derive_builder::Builder;
99
use eyre::Result;
1010
use foundry_config::Config;
1111
use serde::Serialize;
12-
use std::{iter::repeat, path::PathBuf};
12+
use std::path::PathBuf;
1313

1414
/// Container for multiple wallets.
1515
#[derive(Debug, Default)]
@@ -249,7 +249,10 @@ impl MultiWalletOpts {
249249
signers.extend(mnemonics);
250250
}
251251
if self.interactives > 0 {
252-
pending.extend(repeat(PendingSigner::Interactive).take(self.interactives as usize));
252+
pending.extend(std::iter::repeat_n(
253+
PendingSigner::Interactive,
254+
self.interactives as usize,
255+
));
253256
}
254257

255258
Ok(MultiWallet::new(pending, signers))

0 commit comments

Comments
 (0)