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
-
46
1
error: 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
92
3
|
93
4
LL | for i in 0..vec.len() {
94
5
| ^^^^^^^^^^^^
95
6
|
7
+ = note: `-D clippy::needless-range-loop` implied by `-D warnings`
96
8
help: consider using an iterator
97
9
|
98
10
LL | for <item> in &vec {
99
11
| ^^^^^^ ^^^^
100
12
101
13
error: 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
103
15
|
104
16
LL | for i in 0..vec.len() {
105
17
| ^^^^^^^^^^^^
@@ -110,7 +22,7 @@ LL | for <item> in &vec {
110
22
| ^^^^^^ ^^^^
111
23
112
24
error: 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
114
26
|
115
27
LL | for j in 0..4 {
116
28
| ^^^^
@@ -121,7 +33,7 @@ LL | for <item> in &STATIC {
121
33
| ^^^^^^ ^^^^^^^
122
34
123
35
error: 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
125
37
|
126
38
LL | for j in 0..4 {
127
39
| ^^^^
@@ -132,7 +44,7 @@ LL | for <item> in &CONST {
132
44
| ^^^^^^ ^^^^^^
133
45
134
46
error: 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
136
48
|
137
49
LL | for i in 0..vec.len() {
138
50
| ^^^^^^^^^^^^
@@ -143,7 +55,7 @@ LL | for (i, <item>) in vec.iter().enumerate() {
143
55
| ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^
144
56
145
57
error: 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
147
59
|
148
60
LL | for i in 0..vec.len() {
149
61
| ^^^^^^^^^^^^
@@ -154,7 +66,7 @@ LL | for <item> in vec2.iter().take(vec.len()) {
154
66
| ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
155
67
156
68
error: 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
158
70
|
159
71
LL | for i in 5..vec.len() {
160
72
| ^^^^^^^^^^^^
@@ -165,7 +77,7 @@ LL | for <item> in vec.iter().skip(5) {
165
77
| ^^^^^^ ^^^^^^^^^^^^^^^^^^
166
78
167
79
error: 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
169
81
|
170
82
LL | for i in 0..MAX_LEN {
171
83
| ^^^^^^^^^^
@@ -176,7 +88,7 @@ LL | for <item> in vec.iter().take(MAX_LEN) {
176
88
| ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^
177
89
178
90
error: 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
180
92
|
181
93
LL | for i in 0..=MAX_LEN {
182
94
| ^^^^^^^^^^^
@@ -187,7 +99,7 @@ LL | for <item> in vec.iter().take(MAX_LEN + 1) {
187
99
| ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
188
100
189
101
error: 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
191
103
|
192
104
LL | for i in 5..10 {
193
105
| ^^^^^
@@ -198,7 +110,7 @@ LL | for <item> in vec.iter().take(10).skip(5) {
198
110
| ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
199
111
200
112
error: 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
202
114
|
203
115
LL | for i in 5..=10 {
204
116
| ^^^^^^
@@ -209,7 +121,7 @@ LL | for <item> in vec.iter().take(10 + 1).skip(5) {
209
121
| ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
210
122
211
123
error: 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
213
125
|
214
126
LL | for i in 5..vec.len() {
215
127
| ^^^^^^^^^^^^
@@ -220,7 +132,7 @@ LL | for (i, <item>) in vec.iter().enumerate().skip(5) {
220
132
| ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
221
133
222
134
error: 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
224
136
|
225
137
LL | for i in 5..10 {
226
138
| ^^^^^
@@ -231,7 +143,7 @@ LL | for (i, <item>) in vec.iter().enumerate().take(10).skip(5) {
231
143
| ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
232
144
233
145
error: 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
235
147
|
236
148
LL | for i in 0..vec.len() {
237
149
| ^^^^^^^^^^^^
@@ -241,5 +153,5 @@ help: consider using an iterator
241
153
LL | for (i, <item>) in vec.iter_mut().enumerate() {
242
154
| ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
243
155
244
- error: aborting due to 22 previous errors
156
+ error: aborting due to 14 previous errors
245
157
0 commit comments