Skip to content

Commit c8e17a9

Browse files
authored
fizzy: iter instead of into_iter (#1004)
clippy: warning: this `.into_iter()` call is equivalent to `.iter()` and will not move the `array` note: `#[warn(clippy::into_iter_on_ref)]` on by default help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref Readability. Calling `into_iter` on a reference will not move out its content into the resulting iterator, which is confusing. It is better just call `iter` or `iter_mut` directly.
1 parent 98b8fb5 commit c8e17a9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

exercises/fizzy/tests/fizzy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ fn test_nonsequential() {
3737
"fizz", "fizz", "fizz", "buzz", "buzz", "16", "8", "4", "2", "1",
3838
];
3939
let got = fizz_buzz::<i32>()
40-
.apply(collatz_12.into_iter().cloned())
40+
.apply(collatz_12.iter().cloned())
4141
.collect::<Vec<_>>();
4242
assert_eq!(expect, got);
4343
}

0 commit comments

Comments
 (0)