Skip to content

Commit 6a4e7e8

Browse files
committed
save
1 parent b3ef467 commit 6a4e7e8

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

crates/cli/src/opts/dependency.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ mod tests {
160160

161161
#[test]
162162
fn parses_dependencies() {
163-
for (input, expected_path, expected_tag, expected_alias) in [
163+
for (input, expected_path, expected_tag, expected_alias) in &[
164164
("gakonst/lootloose", "https://github.com/gakonst/lootloose", None, None),
165165
("github.com/gakonst/lootloose", "https://github.com/gakonst/lootloose", None, None),
166166
(
@@ -242,8 +242,7 @@ mod tests {
242242
Some("v1"),
243243
Some("loot"),
244244
),
245-
]
246-
.iter() {
245+
] {
247246
let dep = Dependency::from_str(input).unwrap();
248247
assert_eq!(dep.url, Some(expected_path.to_string()));
249248
assert_eq!(dep.tag, expected_tag.map(ToString::to_string));
@@ -269,15 +268,14 @@ mod tests {
269268

270269
#[test]
271270
fn parses_contract_info() {
272-
for (input, expected_path, expected_name) in [
271+
for (input, expected_path, expected_name) in &[
273272
(
274273
"src/contracts/Contracts.sol:Contract",
275274
Some("src/contracts/Contracts.sol"),
276275
"Contract",
277276
),
278277
("Contract", None, "Contract"),
279-
]
280-
.iter() {
278+
] {
281279
let contract = ContractInfo::from_str(input).unwrap();
282280
assert_eq!(contract.path, expected_path.map(ToString::to_string));
283281
assert_eq!(contract.name, expected_name.to_string());
@@ -286,7 +284,7 @@ mod tests {
286284

287285
#[test]
288286
fn contract_info_should_reject_without_name() {
289-
for input in ["src/contracts/", "src/contracts/Contracts.sol"].iter() {
287+
for input in &["src/contracts/", "src/contracts/Contracts.sol"] {
290288
let contract = ContractInfo::from_str(input);
291289
assert!(contract.is_err())
292290
}

crates/forge/src/cmd/clone.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ mod tests {
645645
stripped_creation_code: &str,
646646
) {
647647
compiled.compiled_contracts_by_compiler_version().iter().for_each(|(_, contracts)| {
648-
for (name, contract) in contracts.iter() {
648+
for (name, contract) in contracts {
649649
if name == contract_name {
650650
let compiled_creation_code =
651651
contract.bin_ref().expect("creation code not found");

0 commit comments

Comments
 (0)