Skip to content

Commit fc820ba

Browse files
authored
Update iter_any.md
Line#38 used iter() method instead of into_iter as specified in the comment on line#37. Modified code from: println!("2 in array2: {}", array2.iter().any(|&x| x == 2)); to: println!("2 in array2: {}", array2.into_iter().any(|x| x == 2));
1 parent ec954f3 commit fc820ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/fn/closures/closure_examples/iter_any.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ fn main() {
3535
// `iter()` for arrays yields `&i32`.
3636
println!("2 in array1: {}", array1.iter() .any(|&x| x == 2));
3737
// `into_iter()` for arrays yields `i32`.
38-
println!("2 in array2: {}", array2.iter().any(|&x| x == 2));
38+
println!("2 in array2: {}", array2.into_iter().any(|x| x == 2));
3939
}
4040
```
4141

0 commit comments

Comments
 (0)