1 error: the loop variable `i` is only used to index `ns`.
2 --> $DIR/needless_range_loop2.rs:10:14
7 = note: `-D clippy::needless-range-loop` implied by `-D warnings`
8 help: consider using an iterator
10 LL | for <item> in ns.iter().take(10).skip(3) {
11 | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
13 error: the loop variable `i` is only used to index `ms`.
14 --> $DIR/needless_range_loop2.rs:31:14
16 LL | for i in 0..ms.len() {
19 help: consider using an iterator
21 LL | for <item> in &mut ms {
24 error: the loop variable `i` is only used to index `ms`.
25 --> $DIR/needless_range_loop2.rs:37:14
27 LL | for i in 0..ms.len() {
30 help: consider using an iterator
32 LL | for <item> in &mut ms {
35 error: the loop variable `i` is only used to index `vec`.
36 --> $DIR/needless_range_loop2.rs:61:14
38 LL | for i in x..x + 4 {
41 help: consider using an iterator
43 LL | for <item> in vec.iter_mut().skip(x).take(4) {
44 | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
46 error: the loop variable `i` is only used to index `vec`.
47 --> $DIR/needless_range_loop2.rs:68:14
49 LL | for i in x..=x + 4 {
52 help: consider using an iterator
54 LL | for <item> in vec.iter_mut().skip(x).take(4 + 1) {
55 | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
57 error: the loop variable `i` is only used to index `arr`.
58 --> $DIR/needless_range_loop2.rs:74:14
63 help: consider using an iterator
65 LL | for <item> in &arr {
68 error: the loop variable `i` is only used to index `arr`.
69 --> $DIR/needless_range_loop2.rs:78:14
74 help: consider using an iterator
76 LL | for <item> in arr.iter().take(2) {
77 | ^^^^^^ ^^^^^^^^^^^^^^^^^^
79 error: the loop variable `i` is only used to index `arr`.
80 --> $DIR/needless_range_loop2.rs:82:14
85 help: consider using an iterator
87 LL | for <item> in arr.iter().skip(1) {
88 | ^^^^^^ ^^^^^^^^^^^^^^^^^^
90 error: aborting due to 8 previous errors