1
1
error: it is more concise to loop over references to containers instead of using explicit iteration methods
2
- --> $DIR/explicit_iter_loop.rs:16 :14
2
+ --> $DIR/explicit_iter_loop.rs:17 :14
3
3
|
4
4
LL | for _ in vec.iter() {}
5
5
| ^^^^^^^^^^ help: to write this more concisely, try: `&vec`
@@ -11,132 +11,106 @@ LL | #![deny(clippy::explicit_iter_loop)]
11
11
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
12
12
13
13
error: it is more concise to loop over references to containers instead of using explicit iteration methods
14
- --> $DIR/explicit_iter_loop.rs:17 :14
14
+ --> $DIR/explicit_iter_loop.rs:18 :14
15
15
|
16
16
LL | for _ in vec.iter_mut() {}
17
17
| ^^^^^^^^^^^^^^ help: to write this more concisely, try: `&mut vec`
18
18
19
19
error: it is more concise to loop over references to containers instead of using explicit iteration methods
20
- --> $DIR/explicit_iter_loop.rs:20 :14
20
+ --> $DIR/explicit_iter_loop.rs:21 :14
21
21
|
22
22
LL | for _ in rvec.iter() {}
23
23
| ^^^^^^^^^^^ help: to write this more concisely, try: `rvec`
24
24
25
25
error: it is more concise to loop over references to containers instead of using explicit iteration methods
26
- --> $DIR/explicit_iter_loop.rs:23:14
27
- |
28
- LL | for _ in rmvec.iter() {}
29
- | ^^^^^^^^^^^^ help: to write this more concisely, try: `&*rmvec`
30
-
31
- error: it is more concise to loop over references to containers instead of using explicit iteration methods
32
- --> $DIR/explicit_iter_loop.rs:24:14
33
- |
34
- LL | for _ in rmvec.iter_mut() {}
35
- | ^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&mut *rmvec`
36
-
37
- error: it is more concise to loop over references to containers instead of using explicit iteration methods
38
- --> $DIR/explicit_iter_loop.rs:29:14
26
+ --> $DIR/explicit_iter_loop.rs:30:14
39
27
|
40
28
LL | for _ in [1, 2, 3].iter() {}
41
29
| ^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&[1, 2, 3]`
42
30
43
31
error: it is more concise to loop over references to containers instead of using explicit iteration methods
44
- --> $DIR/explicit_iter_loop.rs:31:14
45
- |
46
- LL | for _ in (&mut [1, 2, 3]).iter() {}
47
- | ^^^^^^^^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&*(&mut [1, 2, 3])`
48
-
49
- error: the method `iter` doesn't need a mutable reference
50
- --> $DIR/explicit_iter_loop.rs:31:14
51
- |
52
- LL | for _ in (&mut [1, 2, 3]).iter() {}
53
- | ^^^^^^^^^^^^^^^^
54
- |
55
- = note: `-D clippy::unnecessary-mut-passed` implied by `-D warnings`
56
-
57
- error: it is more concise to loop over references to containers instead of using explicit iteration methods
58
- --> $DIR/explicit_iter_loop.rs:33:14
32
+ --> $DIR/explicit_iter_loop.rs:34:14
59
33
|
60
34
LL | for _ in [0; 32].iter() {}
61
35
| ^^^^^^^^^^^^^^ help: to write this more concisely, try: `&[0; 32]`
62
36
63
37
error: it is more concise to loop over references to containers instead of using explicit iteration methods
64
- --> $DIR/explicit_iter_loop.rs:34 :14
38
+ --> $DIR/explicit_iter_loop.rs:35 :14
65
39
|
66
40
LL | for _ in [0; 33].iter() {}
67
41
| ^^^^^^^^^^^^^^ help: to write this more concisely, try: `&[0; 33]`
68
42
69
43
error: it is more concise to loop over references to containers instead of using explicit iteration methods
70
- --> $DIR/explicit_iter_loop.rs:37 :14
44
+ --> $DIR/explicit_iter_loop.rs:38 :14
71
45
|
72
46
LL | for _ in ll.iter() {}
73
47
| ^^^^^^^^^ help: to write this more concisely, try: `&ll`
74
48
75
49
error: it is more concise to loop over references to containers instead of using explicit iteration methods
76
- --> $DIR/explicit_iter_loop.rs:39 :14
50
+ --> $DIR/explicit_iter_loop.rs:40 :14
77
51
|
78
52
LL | for _ in rll.iter() {}
79
53
| ^^^^^^^^^^ help: to write this more concisely, try: `rll`
80
54
81
55
error: it is more concise to loop over references to containers instead of using explicit iteration methods
82
- --> $DIR/explicit_iter_loop.rs:42 :14
56
+ --> $DIR/explicit_iter_loop.rs:43 :14
83
57
|
84
58
LL | for _ in vd.iter() {}
85
59
| ^^^^^^^^^ help: to write this more concisely, try: `&vd`
86
60
87
61
error: it is more concise to loop over references to containers instead of using explicit iteration methods
88
- --> $DIR/explicit_iter_loop.rs:44 :14
62
+ --> $DIR/explicit_iter_loop.rs:45 :14
89
63
|
90
64
LL | for _ in rvd.iter() {}
91
65
| ^^^^^^^^^^ help: to write this more concisely, try: `rvd`
92
66
93
67
error: it is more concise to loop over references to containers instead of using explicit iteration methods
94
- --> $DIR/explicit_iter_loop.rs:47 :14
68
+ --> $DIR/explicit_iter_loop.rs:48 :14
95
69
|
96
70
LL | for _ in bh.iter() {}
97
71
| ^^^^^^^^^ help: to write this more concisely, try: `&bh`
98
72
99
73
error: it is more concise to loop over references to containers instead of using explicit iteration methods
100
- --> $DIR/explicit_iter_loop.rs:50 :14
74
+ --> $DIR/explicit_iter_loop.rs:51 :14
101
75
|
102
76
LL | for _ in hm.iter() {}
103
77
| ^^^^^^^^^ help: to write this more concisely, try: `&hm`
104
78
105
79
error: it is more concise to loop over references to containers instead of using explicit iteration methods
106
- --> $DIR/explicit_iter_loop.rs:53 :14
80
+ --> $DIR/explicit_iter_loop.rs:54 :14
107
81
|
108
82
LL | for _ in bt.iter() {}
109
83
| ^^^^^^^^^ help: to write this more concisely, try: `&bt`
110
84
111
85
error: it is more concise to loop over references to containers instead of using explicit iteration methods
112
- --> $DIR/explicit_iter_loop.rs:56 :14
86
+ --> $DIR/explicit_iter_loop.rs:57 :14
113
87
|
114
88
LL | for _ in hs.iter() {}
115
89
| ^^^^^^^^^ help: to write this more concisely, try: `&hs`
116
90
117
91
error: it is more concise to loop over references to containers instead of using explicit iteration methods
118
- --> $DIR/explicit_iter_loop.rs:59 :14
92
+ --> $DIR/explicit_iter_loop.rs:60 :14
119
93
|
120
94
LL | for _ in bs.iter() {}
121
95
| ^^^^^^^^^ help: to write this more concisely, try: `&bs`
122
96
123
97
error: it is more concise to loop over references to containers instead of using explicit iteration methods
124
- --> $DIR/explicit_iter_loop.rs:148 :14
98
+ --> $DIR/explicit_iter_loop.rs:149 :14
125
99
|
126
100
LL | for _ in x.iter() {}
127
101
| ^^^^^^^^ help: to write this more concisely, try: `&x`
128
102
129
103
error: it is more concise to loop over references to containers instead of using explicit iteration methods
130
- --> $DIR/explicit_iter_loop.rs:149 :14
104
+ --> $DIR/explicit_iter_loop.rs:150 :14
131
105
|
132
106
LL | for _ in x.iter_mut() {}
133
107
| ^^^^^^^^^^^^ help: to write this more concisely, try: `&mut x`
134
108
135
109
error: it is more concise to loop over references to containers instead of using explicit iteration methods
136
- --> $DIR/explicit_iter_loop.rs:152 :14
110
+ --> $DIR/explicit_iter_loop.rs:153 :14
137
111
|
138
112
LL | for _ in r.iter() {}
139
113
| ^^^^^^^^ help: to write this more concisely, try: `r`
140
114
141
- error: aborting due to 22 previous errors
115
+ error: aborting due to 18 previous errors
142
116
0 commit comments