|
1 | 1 | error: this `.fold` can be written more succinctly using another method
|
2 |
| - --> $DIR/unnecessary_fold.rs:4:19 |
| 2 | + --> $DIR/unnecessary_fold.rs:8:19 |
3 | 3 | |
|
4 | 4 | LL | let _ = (0..3).fold(false, |acc, x| acc || x > 2);
|
5 | 5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.any(|x| x > 2)`
|
6 | 6 | |
|
7 | 7 | = note: `-D clippy::unnecessary-fold` implied by `-D warnings`
|
8 | 8 |
|
9 | 9 | error: this `.fold` can be written more succinctly using another method
|
10 |
| - --> $DIR/unnecessary_fold.rs:6:19 |
| 10 | + --> $DIR/unnecessary_fold.rs:10:19 |
11 | 11 | |
|
12 | 12 | LL | let _ = (0..3).fold(true, |acc, x| acc && x > 2);
|
13 | 13 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.all(|x| x > 2)`
|
14 | 14 |
|
15 | 15 | error: this `.fold` can be written more succinctly using another method
|
16 |
| - --> $DIR/unnecessary_fold.rs:8:19 |
| 16 | + --> $DIR/unnecessary_fold.rs:12:24 |
17 | 17 | |
|
18 |
| -LL | let _ = (0..3).fold(0, |acc, x| acc + x); |
19 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.sum()` |
| 18 | +LL | let _: i32 = (0..3).fold(0, |acc, x| acc + x); |
| 19 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.sum()` |
20 | 20 |
|
21 | 21 | error: this `.fold` can be written more succinctly using another method
|
22 |
| - --> $DIR/unnecessary_fold.rs:10:19 |
| 22 | + --> $DIR/unnecessary_fold.rs:14:24 |
23 | 23 | |
|
24 |
| -LL | let _ = (0..3).fold(1, |acc, x| acc * x); |
25 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.product()` |
| 24 | +LL | let _: i32 = (0..3).fold(1, |acc, x| acc * x); |
| 25 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.product()` |
26 | 26 |
|
27 | 27 | error: this `.fold` can be written more succinctly using another method
|
28 |
| - --> $DIR/unnecessary_fold.rs:15:34 |
| 28 | + --> $DIR/unnecessary_fold.rs:19:40 |
29 | 29 | |
|
30 |
| -LL | let _ = (0..3).map(|x| 2 * x).fold(false, |acc, x| acc || x > 2); |
31 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.any(|x| x > 2)` |
| 30 | +LL | let _: bool = (0..3).map(|x| 2 * x).fold(false, |acc, x| acc || x > 2); |
| 31 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.any(|x| x > 2)` |
32 | 32 |
|
33 | 33 | error: aborting due to 5 previous errors
|
34 | 34 |
|
0 commit comments