Skip to content
Closed
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
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ implicit_clone = "warn"
if_not_else = "warn"
imprecise_flops = "warn"
iter_on_empty_collections = "warn"
iter_on_single_items = "warn"
iter_with_drain = "warn"
iter_without_into_iter = "warn"
manual_assert = "warn"
Expand Down
18 changes: 6 additions & 12 deletions crates/anvil/tests/it/tempo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2189,8 +2189,7 @@ async fn test_gas_estimation_tempo_aa_transaction() {

let tx: WithOtherFields<TransactionRequest> = WithOtherFields {
inner: TransactionRequest::default().from(accounts[0]).to(PATH_USD).with_input(calldata),
other: [("feeToken".to_string(), serde_json::json!(PATH_USD.to_string()))]
.into_iter()
other: std::iter::once(("feeToken".to_string(), serde_json::json!(PATH_USD.to_string())))
.collect(),
};

Expand Down Expand Up @@ -2224,8 +2223,7 @@ async fn test_gas_estimation_tempo_aa_with_2d_nonce() {
.from(accounts[0])
.to(PATH_USD)
.with_input(calldata.clone()),
other: [("feeToken".to_string(), serde_json::json!(PATH_USD.to_string()))]
.into_iter()
other: std::iter::once(("feeToken".to_string(), serde_json::json!(PATH_USD.to_string())))
.collect(),
};
let baseline_gas = provider.estimate_gas(baseline_tx).await.unwrap();
Expand Down Expand Up @@ -2278,8 +2276,7 @@ async fn test_gas_estimation_tempo_aa_expiring_nonce() {
.from(accounts[0])
.to(PATH_USD)
.with_input(calldata.clone()),
other: [("feeToken".to_string(), serde_json::json!(PATH_USD.to_string()))]
.into_iter()
other: std::iter::once(("feeToken".to_string(), serde_json::json!(PATH_USD.to_string())))
.collect(),
};
let baseline_gas = provider.estimate_gas(baseline_tx).await.unwrap();
Expand Down Expand Up @@ -2337,8 +2334,7 @@ async fn test_gas_estimation_t1_nonce_costs() {
.from(accounts[0])
.to(PATH_USD)
.with_input(calldata.clone()),
other: [("feeToken".to_string(), serde_json::json!(PATH_USD.to_string()))]
.into_iter()
other: std::iter::once(("feeToken".to_string(), serde_json::json!(PATH_USD.to_string())))
.collect(),
};
let baseline_gas = provider.estimate_gas(baseline_tx).await.unwrap();
Expand Down Expand Up @@ -2371,8 +2367,7 @@ async fn test_gas_estimation_t1_nonce_costs() {
.to(PATH_USD)
.with_input(calldata.clone())
.with_nonce(1),
other: [("feeToken".to_string(), serde_json::json!(PATH_USD.to_string()))]
.into_iter()
other: std::iter::once(("feeToken".to_string(), serde_json::json!(PATH_USD.to_string())))
.collect(),
};
let baseline_nonce1_gas = provider.estimate_gas(baseline_nonce1_tx).await.unwrap();
Expand Down Expand Up @@ -2521,8 +2516,7 @@ async fn test_gas_estimation_converges_for_tempo_intrinsic_gas() {
.from(accounts[0])
.to(PATH_USD)
.with_input(calldata.clone()),
other: [("feeToken".to_string(), serde_json::json!(PATH_USD.to_string()))]
.into_iter()
other: std::iter::once(("feeToken".to_string(), serde_json::json!(PATH_USD.to_string())))
.collect(),
};

Expand Down
7 changes: 3 additions & 4 deletions crates/config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1982,11 +1982,10 @@ impl Config {
})
.collect::<Vec<_>>();
// wrap inner table in [profile.<profile>]
let mut wrapping_table = [(
let mut wrapping_table = std::iter::once((
Self::PROFILE_SECTION.into(),
toml::Value::Table([(self.profile.to_string(), value)].into_iter().collect()),
)]
.into_iter()
toml::Value::Table(std::iter::once((self.profile.to_string(), value)).collect()),
))
.collect::<toml::map::Map<_, _>>();
// insert standalone sections
for (section, value) in standalone_sections {
Expand Down
8 changes: 4 additions & 4 deletions crates/doc/src/preprocessor/infer_hyperlinks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ impl InferInlineHyperlinks {
Self::find_match(
&link,
doc.relative_output_path(),
doc.content.iter_items().flat_map(|item| {
Some(item).into_iter().chain(item.children.iter())
}),
doc.content
.iter_items()
.flat_map(|item| std::iter::once(item).chain(item.children.iter())),
)
})
} else {
Expand All @@ -182,7 +182,7 @@ impl InferInlineHyperlinks {
parent
.content
.iter_items()
.flat_map(|item| Some(item).into_iter().chain(item.children.iter())),
.flat_map(|item| std::iter::once(item).chain(item.children.iter())),
)
};
if let Some(target) = target {
Expand Down
2 changes: 1 addition & 1 deletion crates/forge/src/cmd/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ impl TypedValueParser for ChainOrAllValueParser {
}

fn possible_chains() -> PossibleValuesParser {
Some(&"all").into_iter().chain(NamedChain::VARIANTS).into()
std::iter::once(&"all").chain(NamedChain::VARIANTS).into()
}

#[cfg(test)]
Expand Down
Loading