1
1
error: unnecessary `if let` since only the `Some` variant of the iterator element is used
2
- --> $DIR/manual_flatten.rs:6 :5
2
+ --> $DIR/manual_flatten.rs:7 :5
3
3
|
4
4
LL | for n in x {
5
5
| ^ - help: try: `x.into_iter().flatten()`
@@ -13,15 +13,15 @@ LL | | }
13
13
|
14
14
= note: `-D clippy::manual-flatten` implied by `-D warnings`
15
15
help: ...and remove the `if let` statement in the for loop
16
- --> $DIR/manual_flatten.rs:7 :9
16
+ --> $DIR/manual_flatten.rs:8 :9
17
17
|
18
18
LL | / if let Some(y) = n {
19
19
LL | | println!("{}", y);
20
20
LL | | }
21
21
| |_________^
22
22
23
23
error: unnecessary `if let` since only the `Ok` variant of the iterator element is used
24
- --> $DIR/manual_flatten.rs:14 :5
24
+ --> $DIR/manual_flatten.rs:15 :5
25
25
|
26
26
LL | for n in y.clone() {
27
27
| ^ --------- help: try: `y.clone().into_iter().flatten()`
@@ -34,15 +34,15 @@ LL | | }
34
34
| |_____^
35
35
|
36
36
help: ...and remove the `if let` statement in the for loop
37
- --> $DIR/manual_flatten.rs:15 :9
37
+ --> $DIR/manual_flatten.rs:16 :9
38
38
|
39
39
LL | / if let Ok(n) = n {
40
40
LL | | println!("{}", n);
41
41
LL | | };
42
42
| |_________^
43
43
44
44
error: unnecessary `if let` since only the `Ok` variant of the iterator element is used
45
- --> $DIR/manual_flatten.rs:21 :5
45
+ --> $DIR/manual_flatten.rs:22 :5
46
46
|
47
47
LL | for n in &y {
48
48
| ^ -- help: try: `y.iter().flatten()`
@@ -55,15 +55,15 @@ LL | | }
55
55
| |_____^
56
56
|
57
57
help: ...and remove the `if let` statement in the for loop
58
- --> $DIR/manual_flatten.rs:22 :9
58
+ --> $DIR/manual_flatten.rs:23 :9
59
59
|
60
60
LL | / if let Ok(n) = n {
61
61
LL | | println!("{}", n);
62
62
LL | | }
63
63
| |_________^
64
64
65
65
error: unnecessary `if let` since only the `Ok` variant of the iterator element is used
66
- --> $DIR/manual_flatten.rs:31 :5
66
+ --> $DIR/manual_flatten.rs:32 :5
67
67
|
68
68
LL | for n in z {
69
69
| ^ - help: try: `z.into_iter().flatten()`
@@ -76,15 +76,15 @@ LL | | }
76
76
| |_____^
77
77
|
78
78
help: ...and remove the `if let` statement in the for loop
79
- --> $DIR/manual_flatten.rs:32 :9
79
+ --> $DIR/manual_flatten.rs:33 :9
80
80
|
81
81
LL | / if let Ok(n) = n {
82
82
LL | | println!("{}", n);
83
83
LL | | }
84
84
| |_________^
85
85
86
86
error: unnecessary `if let` since only the `Some` variant of the iterator element is used
87
- --> $DIR/manual_flatten.rs:40 :5
87
+ --> $DIR/manual_flatten.rs:41 :5
88
88
|
89
89
LL | for n in z {
90
90
| ^ - help: try: `z.flatten()`
@@ -97,12 +97,75 @@ LL | | }
97
97
| |_____^
98
98
|
99
99
help: ...and remove the `if let` statement in the for loop
100
- --> $DIR/manual_flatten.rs:41 :9
100
+ --> $DIR/manual_flatten.rs:42 :9
101
101
|
102
102
LL | / if let Some(m) = n {
103
103
LL | | println!("{}", m);
104
104
LL | | }
105
105
| |_________^
106
106
107
- error: aborting due to 5 previous errors
107
+ error: unnecessary `if let` since only the `Some` variant of the iterator element is used
108
+ --> $DIR/manual_flatten.rs:74:5
109
+ |
110
+ LL | for n in &vec_of_ref {
111
+ | ^ ----------- help: try: `vec_of_ref.iter().copied().flatten()`
112
+ | _____|
113
+ | |
114
+ LL | | if let Some(n) = n {
115
+ LL | | println!("{:?}", n);
116
+ LL | | }
117
+ LL | | }
118
+ | |_____^
119
+ |
120
+ help: ...and remove the `if let` statement in the for loop
121
+ --> $DIR/manual_flatten.rs:75:9
122
+ |
123
+ LL | / if let Some(n) = n {
124
+ LL | | println!("{:?}", n);
125
+ LL | | }
126
+ | |_________^
127
+
128
+ error: unnecessary `if let` since only the `Some` variant of the iterator element is used
129
+ --> $DIR/manual_flatten.rs:81:5
130
+ |
131
+ LL | for n in vec_of_ref {
132
+ | ^ ---------- help: try: `vec_of_ref.into_iter().copied().flatten()`
133
+ | _____|
134
+ | |
135
+ LL | | if let Some(n) = n {
136
+ LL | | println!("{:?}", n);
137
+ LL | | }
138
+ LL | | }
139
+ | |_____^
140
+ |
141
+ help: ...and remove the `if let` statement in the for loop
142
+ --> $DIR/manual_flatten.rs:82:9
143
+ |
144
+ LL | / if let Some(n) = n {
145
+ LL | | println!("{:?}", n);
146
+ LL | | }
147
+ | |_________^
148
+
149
+ error: unnecessary `if let` since only the `Some` variant of the iterator element is used
150
+ --> $DIR/manual_flatten.rs:88:5
151
+ |
152
+ LL | for n in slice_of_ref {
153
+ | ^ ------------ help: try: `slice_of_ref.into_iter().copied().flatten()`
154
+ | _____|
155
+ | |
156
+ LL | | if let Some(n) = n {
157
+ LL | | println!("{:?}", n);
158
+ LL | | }
159
+ LL | | }
160
+ | |_____^
161
+ |
162
+ help: ...and remove the `if let` statement in the for loop
163
+ --> $DIR/manual_flatten.rs:89:9
164
+ |
165
+ LL | / if let Some(n) = n {
166
+ LL | | println!("{:?}", n);
167
+ LL | | }
168
+ | |_________^
169
+
170
+ error: aborting due to 8 previous errors
108
171
0 commit comments