rust/tests/ui/manual_flatten.stderr
2021-02-02 23:43:17 +01:00

45 lines
1.3 KiB
Plaintext

error: unnecessary `if let` since only the `Some` variant of the iterator element is used
--> $DIR/manual_flatten.rs:6:5
|
LL | / for n in x {
LL | | if let Some(n) = n {
LL | | println!("{}", n);
LL | | }
LL | | }
| |_____^ help: try: `x.into_iter().flatten()`
|
= note: `-D clippy::manual-flatten` implied by `-D warnings`
error: unnecessary `if let` since only the `Ok` variant of the iterator element is used
--> $DIR/manual_flatten.rs:14:5
|
LL | / for n in y.clone() {
LL | | if let Ok(n) = n {
LL | | println!("{}", n);
LL | | };
LL | | }
| |_____^ help: try: `y.clone().into_iter().flatten()`
error: unnecessary `if let` since only the `Ok` variant of the iterator element is used
--> $DIR/manual_flatten.rs:21:5
|
LL | / for n in &y {
LL | | if let Ok(n) = n {
LL | | println!("{}", n);
LL | | }
LL | | }
| |_____^ help: try: `y.iter().flatten()`
error: unnecessary `if let` since only the `Some` variant of the iterator element is used
--> $DIR/manual_flatten.rs:30:5
|
LL | / for n in z {
LL | | if let Some(n) = n {
LL | | println!("{}", n);
LL | | }
LL | | }
| |_____^ help: try: `z.flatten()`
error: aborting due to 4 previous errors