1- error: the loop variable `i` is only used to index `ns`.
2- --> $DIR/needless_range_loop.rs:15:14
3- |
4- LL | for i in 3..10 {
5- | ^^^^^
6- |
7- = note: `-D clippy::needless-range-loop` implied by `-D warnings`
8- help: consider using an iterator
9- |
10- LL | for <item> in ns.iter().take(10).skip(3) {
11- | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
12-
13- error: the loop variable `i` is only used to index `ms`.
14- --> $DIR/needless_range_loop.rs:36:14
15- |
16- LL | for i in 0..ms.len() {
17- | ^^^^^^^^^^^
18- |
19- help: consider using an iterator
20- |
21- LL | for <item> in &mut ms {
22- | ^^^^^^ ^^^^^^^
23-
24- error: the loop variable `i` is only used to index `ms`.
25- --> $DIR/needless_range_loop.rs:42:14
26- |
27- LL | for i in 0..ms.len() {
28- | ^^^^^^^^^^^
29- |
30- help: consider using an iterator
31- |
32- LL | for <item> in &mut ms {
33- | ^^^^^^ ^^^^^^^
34-
35- error: the loop variable `i` is only used to index `vec`.
36- --> $DIR/needless_range_loop.rs:66:14
37- |
38- LL | for i in x..x + 4 {
39- | ^^^^^^^^
40- |
41- help: consider using an iterator
42- |
43- LL | for <item> in vec.iter_mut().skip(x).take(4) {
44- | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
45-
461error: the loop variable `i` is only used to index `vec`.
47- --> $DIR/needless_range_loop.rs:73:14
48- |
49- LL | for i in x..=x + 4 {
50- | ^^^^^^^^^
51- |
52- help: consider using an iterator
53- |
54- LL | for <item> in vec.iter_mut().skip(x).take(4 + 1) {
55- | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
56-
57- error: the loop variable `i` is only used to index `arr`.
58- --> $DIR/needless_range_loop.rs:79:14
59- |
60- LL | for i in 0..3 {
61- | ^^^^
62- |
63- help: consider using an iterator
64- |
65- LL | for <item> in &arr {
66- | ^^^^^^ ^^^^
67-
68- error: the loop variable `i` is only used to index `arr`.
69- --> $DIR/needless_range_loop.rs:83:14
70- |
71- LL | for i in 0..2 {
72- | ^^^^
73- |
74- help: consider using an iterator
75- |
76- LL | for <item> in arr.iter().take(2) {
77- | ^^^^^^ ^^^^^^^^^^^^^^^^^^
78-
79- error: the loop variable `i` is only used to index `arr`.
80- --> $DIR/needless_range_loop.rs:87:14
81- |
82- LL | for i in 1..3 {
83- | ^^^^
84- |
85- help: consider using an iterator
86- |
87- LL | for <item> in arr.iter().skip(1) {
88- | ^^^^^^ ^^^^^^^^^^^^^^^^^^
89-
90- error: the loop variable `i` is only used to index `vec`.
91- --> $DIR/needless_range_loop.rs:93:14
2+ --> $DIR/needless_range_loop.rs:10:14
923 |
934LL | for i in 0..vec.len() {
945 | ^^^^^^^^^^^^
956 |
7+ = note: `-D clippy::needless-range-loop` implied by `-D warnings`
968help: consider using an iterator
979 |
9810LL | for <item> in &vec {
9911 | ^^^^^^ ^^^^
10012
10113error: the loop variable `i` is only used to index `vec`.
102- --> $DIR/needless_range_loop.rs:102 :14
14+ --> $DIR/needless_range_loop.rs:19 :14
10315 |
10416LL | for i in 0..vec.len() {
10517 | ^^^^^^^^^^^^
@@ -110,7 +22,7 @@ LL | for <item> in &vec {
11022 | ^^^^^^ ^^^^
11123
11224error: the loop variable `j` is only used to index `STATIC`.
113- --> $DIR/needless_range_loop.rs:107 :14
25+ --> $DIR/needless_range_loop.rs:24 :14
11426 |
11527LL | for j in 0..4 {
11628 | ^^^^
@@ -121,7 +33,7 @@ LL | for <item> in &STATIC {
12133 | ^^^^^^ ^^^^^^^
12234
12335error: the loop variable `j` is only used to index `CONST`.
124- --> $DIR/needless_range_loop.rs:111 :14
36+ --> $DIR/needless_range_loop.rs:28 :14
12537 |
12638LL | for j in 0..4 {
12739 | ^^^^
@@ -132,7 +44,7 @@ LL | for <item> in &CONST {
13244 | ^^^^^^ ^^^^^^
13345
13446error: the loop variable `i` is used to index `vec`
135- --> $DIR/needless_range_loop.rs:115 :14
47+ --> $DIR/needless_range_loop.rs:32 :14
13648 |
13749LL | for i in 0..vec.len() {
13850 | ^^^^^^^^^^^^
@@ -143,7 +55,7 @@ LL | for (i, <item>) in vec.iter().enumerate() {
14355 | ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^
14456
14557error: the loop variable `i` is only used to index `vec2`.
146- --> $DIR/needless_range_loop.rs:123 :14
58+ --> $DIR/needless_range_loop.rs:40 :14
14759 |
14860LL | for i in 0..vec.len() {
14961 | ^^^^^^^^^^^^
@@ -154,7 +66,7 @@ LL | for <item> in vec2.iter().take(vec.len()) {
15466 | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
15567
15668error: the loop variable `i` is only used to index `vec`.
157- --> $DIR/needless_range_loop.rs:127 :14
69+ --> $DIR/needless_range_loop.rs:44 :14
15870 |
15971LL | for i in 5..vec.len() {
16072 | ^^^^^^^^^^^^
@@ -165,7 +77,7 @@ LL | for <item> in vec.iter().skip(5) {
16577 | ^^^^^^ ^^^^^^^^^^^^^^^^^^
16678
16779error: the loop variable `i` is only used to index `vec`.
168- --> $DIR/needless_range_loop.rs:131 :14
80+ --> $DIR/needless_range_loop.rs:48 :14
16981 |
17082LL | for i in 0..MAX_LEN {
17183 | ^^^^^^^^^^
@@ -176,7 +88,7 @@ LL | for <item> in vec.iter().take(MAX_LEN) {
17688 | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^
17789
17890error: the loop variable `i` is only used to index `vec`.
179- --> $DIR/needless_range_loop.rs:135 :14
91+ --> $DIR/needless_range_loop.rs:52 :14
18092 |
18193LL | for i in 0..=MAX_LEN {
18294 | ^^^^^^^^^^^
@@ -187,7 +99,7 @@ LL | for <item> in vec.iter().take(MAX_LEN + 1) {
18799 | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
188100
189101error: the loop variable `i` is only used to index `vec`.
190- --> $DIR/needless_range_loop.rs:139 :14
102+ --> $DIR/needless_range_loop.rs:56 :14
191103 |
192104LL | for i in 5..10 {
193105 | ^^^^^
@@ -198,7 +110,7 @@ LL | for <item> in vec.iter().take(10).skip(5) {
198110 | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
199111
200112error: the loop variable `i` is only used to index `vec`.
201- --> $DIR/needless_range_loop.rs:143 :14
113+ --> $DIR/needless_range_loop.rs:60 :14
202114 |
203115LL | for i in 5..=10 {
204116 | ^^^^^^
@@ -209,7 +121,7 @@ LL | for <item> in vec.iter().take(10 + 1).skip(5) {
209121 | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
210122
211123error: the loop variable `i` is used to index `vec`
212- --> $DIR/needless_range_loop.rs:147 :14
124+ --> $DIR/needless_range_loop.rs:64 :14
213125 |
214126LL | for i in 5..vec.len() {
215127 | ^^^^^^^^^^^^
@@ -220,7 +132,7 @@ LL | for (i, <item>) in vec.iter().enumerate().skip(5) {
220132 | ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
221133
222134error: the loop variable `i` is used to index `vec`
223- --> $DIR/needless_range_loop.rs:151 :14
135+ --> $DIR/needless_range_loop.rs:68 :14
224136 |
225137LL | for i in 5..10 {
226138 | ^^^^^
@@ -231,7 +143,7 @@ LL | for (i, <item>) in vec.iter().enumerate().take(10).skip(5) {
231143 | ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
232144
233145error: the loop variable `i` is used to index `vec`
234- --> $DIR/needless_range_loop.rs:156 :14
146+ --> $DIR/needless_range_loop.rs:73 :14
235147 |
236148LL | for i in 0..vec.len() {
237149 | ^^^^^^^^^^^^
@@ -241,5 +153,5 @@ help: consider using an iterator
241153LL | for (i, <item>) in vec.iter_mut().enumerate() {
242154 | ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
243155
244- error: aborting due to 22 previous errors
156+ error: aborting due to 14 previous errors
245157
0 commit comments