Skip to content

Commit 0415d2b

Browse files
committed
Replace .iter().cloned() with .into_iter()
1 parent f110713 commit 0415d2b

File tree

4 files changed

+10
-16
lines changed

4 files changed

+10
-16
lines changed

packages/std/src/math/decimal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1334,7 +1334,7 @@ mod tests {
13341334
];
13351335

13361336
// The regular std::ops::Mul is our source of truth for these tests.
1337-
for (x, y) in test_data.iter().cloned() {
1337+
for (x, y) in test_data.into_iter() {
13381338
assert_eq!(x * y, x.checked_mul(y).unwrap());
13391339
}
13401340
}

packages/std/src/math/decimal256.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1453,7 +1453,7 @@ mod tests {
14531453
];
14541454

14551455
// The regular std::ops::Mul is our source of truth for these tests.
1456-
for (x, y) in test_data.iter().cloned() {
1456+
for (x, y) in test_data.into_iter() {
14571457
assert_eq!(x * y, x.checked_mul(y).unwrap());
14581458
}
14591459
}

packages/vm/src/compatibility.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -652,8 +652,7 @@ mod tests {
652652
"sun".to_string(),
653653
"freedom".to_string(),
654654
]
655-
.iter()
656-
.cloned()
655+
.into_iter()
657656
.collect();
658657
check_wasm_capabilities(&module, &available).unwrap();
659658
}
@@ -681,8 +680,7 @@ mod tests {
681680
"nutrients".to_string(),
682681
"freedom".to_string(),
683682
]
684-
.iter()
685-
.cloned()
683+
.into_iter()
686684
.collect();
687685
match check_wasm_capabilities(&module, &available).unwrap_err() {
688686
VmError::StaticValidationErr { msg, .. } => assert_eq!(
@@ -698,8 +696,7 @@ mod tests {
698696
"freedom".to_string(),
699697
"Water".to_string(), // capabilities are case sensitive (and lowercase by convention)
700698
]
701-
.iter()
702-
.cloned()
699+
.into_iter()
703700
.collect();
704701
match check_wasm_capabilities(&module, &available).unwrap_err() {
705702
VmError::StaticValidationErr { msg, .. } => assert_eq!(
@@ -710,7 +707,7 @@ mod tests {
710707
}
711708

712709
// Available set 3
713-
let available = ["freedom".to_string()].iter().cloned().collect();
710+
let available = ["freedom".to_string()].into_iter().collect();
714711
match check_wasm_capabilities(&module, &available).unwrap_err() {
715712
VmError::StaticValidationErr { msg, .. } => assert_eq!(
716713
msg,
@@ -720,7 +717,7 @@ mod tests {
720717
}
721718

722719
// Available set 4
723-
let available = [].iter().cloned().collect();
720+
let available = [].into_iter().collect();
724721
match check_wasm_capabilities(&module, &available).unwrap_err() {
725722
VmError::StaticValidationErr { msg, .. } => assert_eq!(
726723
msg,

packages/vm/src/limited.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ mod tests {
103103
"apple".to_string(),
104104
"banana".to_string(),
105105
]
106-
.iter()
107-
.cloned()
106+
.into_iter()
108107
.collect();
109108
assert_eq!(
110109
fruits.to_string_limited(100),
@@ -140,8 +139,7 @@ mod tests {
140139
"apple".to_string(),
141140
"banana".to_string(),
142141
]
143-
.iter()
144-
.cloned()
142+
.into_iter()
145143
.collect();
146144
assert_eq!(
147145
fruits.to_string_limited(100),
@@ -180,8 +178,7 @@ mod tests {
180178
"apple".to_string(),
181179
"banana".to_string(),
182180
]
183-
.iter()
184-
.cloned()
181+
.into_iter()
185182
.collect();
186183
assert_eq!(fruits.to_string_limited(15), "{... 3 elements}");
187184
}

0 commit comments

Comments
 (0)