11error: 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
33 |
44LL | for n in x {
55 | ^ - help: try: `x.into_iter().flatten()`
@@ -13,15 +13,15 @@ LL | | }
1313 |
1414 = note: `-D clippy::manual-flatten` implied by `-D warnings`
1515help: ...and remove the `if let` statement in the for loop
16- --> $DIR/manual_flatten.rs:7 :9
16+ --> $DIR/manual_flatten.rs:8 :9
1717 |
1818LL | / if let Some(y) = n {
1919LL | | println!("{}", y);
2020LL | | }
2121 | |_________^
2222
2323error: 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
2525 |
2626LL | for n in y.clone() {
2727 | ^ --------- help: try: `y.clone().into_iter().flatten()`
@@ -34,15 +34,15 @@ LL | | }
3434 | |_____^
3535 |
3636help: ...and remove the `if let` statement in the for loop
37- --> $DIR/manual_flatten.rs:15 :9
37+ --> $DIR/manual_flatten.rs:16 :9
3838 |
3939LL | / if let Ok(n) = n {
4040LL | | println!("{}", n);
4141LL | | };
4242 | |_________^
4343
4444error: 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
4646 |
4747LL | for n in &y {
4848 | ^ -- help: try: `y.iter().flatten()`
@@ -55,15 +55,15 @@ LL | | }
5555 | |_____^
5656 |
5757help: ...and remove the `if let` statement in the for loop
58- --> $DIR/manual_flatten.rs:22 :9
58+ --> $DIR/manual_flatten.rs:23 :9
5959 |
6060LL | / if let Ok(n) = n {
6161LL | | println!("{}", n);
6262LL | | }
6363 | |_________^
6464
6565error: 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
6767 |
6868LL | for n in z {
6969 | ^ - help: try: `z.into_iter().flatten()`
@@ -76,15 +76,15 @@ LL | | }
7676 | |_____^
7777 |
7878help: ...and remove the `if let` statement in the for loop
79- --> $DIR/manual_flatten.rs:32 :9
79+ --> $DIR/manual_flatten.rs:33 :9
8080 |
8181LL | / if let Ok(n) = n {
8282LL | | println!("{}", n);
8383LL | | }
8484 | |_________^
8585
8686error: 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
8888 |
8989LL | for n in z {
9090 | ^ - help: try: `z.flatten()`
@@ -97,12 +97,75 @@ LL | | }
9797 | |_____^
9898 |
9999help: ...and remove the `if let` statement in the for loop
100- --> $DIR/manual_flatten.rs:41 :9
100+ --> $DIR/manual_flatten.rs:42 :9
101101 |
102102LL | / if let Some(m) = n {
103103LL | | println!("{}", m);
104104LL | | }
105105 | |_________^
106106
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
108171
0 commit comments