|
1 | 1 | error: this `map` can be collapsed into the `all`
|
2 |
| - --> $DIR/map_then_identity_transformer.rs:7:27 |
| 2 | + --> $DIR/map_then_identity_transformer.rs:10:27 |
3 | 3 | |
|
4 |
| -LL | let _ = a.into_iter().map(|x| x > 0).all(|x| x); |
| 4 | +LL | let _ = a.into_iter().map(|x| x > 1).all(|y| y); |
5 | 5 | | ^^^
|
6 | 6 | |
|
7 | 7 | = note: `-D clippy::map-then-identity-transformer` implied by `-D warnings`
|
8 | 8 | help: these `map` and `all` can be merged into a single `all`
|
9 |
| - --> $DIR/map_then_identity_transformer.rs:7:35 |
| 9 | + --> $DIR/map_then_identity_transformer.rs:10:35 |
10 | 10 | |
|
11 |
| -LL | let _ = a.into_iter().map(|x| x > 0).all(|x| x); |
| 11 | +LL | let _ = a.into_iter().map(|x| x > 1).all(|y| y); |
12 | 12 | | ^^^^^ ^ replace this variable
|
13 | 13 | | |
|
14 | 14 | | with this expression
|
15 | 15 |
|
16 |
| -error: aborting due to previous error |
| 16 | +error: this `map` can be collapsed into the `any` |
| 17 | + --> $DIR/map_then_identity_transformer.rs:11:27 |
| 18 | + | |
| 19 | +LL | let _ = a.into_iter().map(|x| foo(x)).any(|y| y); |
| 20 | + | ^^^ |
| 21 | + | |
| 22 | +help: these `map` and `any` can be merged into a single `any` |
| 23 | + --> $DIR/map_then_identity_transformer.rs:11:35 |
| 24 | + | |
| 25 | +LL | let _ = a.into_iter().map(|x| foo(x)).any(|y| y); |
| 26 | + | ^^^^^^ ^ replace this variable |
| 27 | + | | |
| 28 | + | with this expression |
| 29 | + |
| 30 | +error: this `map` can be collapsed into the `find_map` |
| 31 | + --> $DIR/map_then_identity_transformer.rs:13:27 |
| 32 | + | |
| 33 | +LL | let _ = a.into_iter().map(|x| x + 10).find_map(|y| Some(y)); |
| 34 | + | ^^^ |
| 35 | + | |
| 36 | +help: these `map` and `find_map` can be merged into a single `find_map` |
| 37 | + --> $DIR/map_then_identity_transformer.rs:13:35 |
| 38 | + | |
| 39 | +LL | let _ = a.into_iter().map(|x| x + 10).find_map(|y| Some(y)); |
| 40 | + | ^^^^^^ ^ replace this variable |
| 41 | + | | |
| 42 | + | with this expression |
| 43 | + |
| 44 | +error: this `map` can be collapsed into the `flat_map` |
| 45 | + --> $DIR/map_then_identity_transformer.rs:14:27 |
| 46 | + | |
| 47 | +LL | let _ = b.into_iter().map(|x| x).flat_map(|y| y.chars()); |
| 48 | + | ^^^ |
| 49 | + | |
| 50 | +help: these `map` and `flat_map` can be merged into a single `flat_map` |
| 51 | + --> $DIR/map_then_identity_transformer.rs:14:35 |
| 52 | + | |
| 53 | +LL | let _ = b.into_iter().map(|x| x).flat_map(|y| y.chars()); |
| 54 | + | ^ ^ replace this variable |
| 55 | + | | |
| 56 | + | with this expression |
| 57 | + |
| 58 | +error: this `map` can be collapsed into the `filter_map` |
| 59 | + --> $DIR/map_then_identity_transformer.rs:15:27 |
| 60 | + | |
| 61 | +LL | let _ = a.into_iter().map(|x| foo(x)).filter_map(|y| Some(!y)); |
| 62 | + | ^^^ |
| 63 | + | |
| 64 | +help: these `map` and `filter_map` can be merged into a single `filter_map` |
| 65 | + --> $DIR/map_then_identity_transformer.rs:15:35 |
| 66 | + | |
| 67 | +LL | let _ = a.into_iter().map(|x| foo(x)).filter_map(|y| Some(!y)); |
| 68 | + | ^^^^^^ with this expression ^ replace this variable |
| 69 | + |
| 70 | +error: this `map` can be collapsed into the `fold` |
| 71 | + --> $DIR/map_then_identity_transformer.rs:16:27 |
| 72 | + | |
| 73 | +LL | let _ = a.into_iter().map(|x| x + 30).fold(1, |pd, x| pd * x + 1); |
| 74 | + | ^^^ |
| 75 | + | |
| 76 | +help: these `map` and `fold` can be merged into a single `fold` |
| 77 | + --> $DIR/map_then_identity_transformer.rs:16:35 |
| 78 | + | |
| 79 | +LL | let _ = a.into_iter().map(|x| x + 30).fold(1, |pd, x| pd * x + 1); |
| 80 | + | ^^^^^^ with this expression ^ replace this variable |
| 81 | + |
| 82 | +error: this `map` can be collapsed into the `map` |
| 83 | + --> $DIR/map_then_identity_transformer.rs:17:27 |
| 84 | + | |
| 85 | +LL | let _ = a.into_iter().map(|x| foo(x)).map(|y| bar(y)); |
| 86 | + | ^^^ |
| 87 | + | |
| 88 | +help: these `map` and `map` can be merged into a single `map` |
| 89 | + --> $DIR/map_then_identity_transformer.rs:17:35 |
| 90 | + | |
| 91 | +LL | let _ = a.into_iter().map(|x| foo(x)).map(|y| bar(y)); |
| 92 | + | ^^^^^^ ^ replace this variable |
| 93 | + | | |
| 94 | + | with this expression |
| 95 | + |
| 96 | +error: aborting due to 7 previous errors |
17 | 97 |
|
0 commit comments