|
1 | 1 | error: this `.fold` can be written more succinctly using another method |
2 | | - --> $DIR/unnecessary_fold.rs:6:20 |
| 2 | + --> $DIR/unnecessary_fold.rs:10:20 |
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 | = help: to override `-D warnings` add `#[allow(clippy::unnecessary_fold)]` |
9 | 9 |
|
| 10 | +error: redundant closure |
| 11 | + --> $DIR/unnecessary_fold.rs:12:32 |
| 12 | + | |
| 13 | +LL | let _ = (0..3).fold(false, |acc, x| is_any(acc, x)); |
| 14 | + | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `is_any` |
| 15 | + | |
| 16 | + = note: `-D clippy::redundant-closure` implied by `-D warnings` |
| 17 | + = help: to override `-D warnings` add `#[allow(clippy::redundant_closure)]` |
| 18 | + |
10 | 19 | error: this `.fold` can be written more succinctly using another method |
11 | | - --> $DIR/unnecessary_fold.rs:8:20 |
| 20 | + --> $DIR/unnecessary_fold.rs:14:20 |
12 | 21 | | |
13 | 22 | LL | let _ = (0..3).fold(true, |acc, x| acc && x > 2); |
14 | 23 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `all(|x| x > 2)` |
15 | 24 |
|
16 | 25 | error: this `.fold` can be written more succinctly using another method |
17 | | - --> $DIR/unnecessary_fold.rs:10:25 |
| 26 | + --> $DIR/unnecessary_fold.rs:16:25 |
18 | 27 | | |
19 | 28 | LL | let _: i32 = (0..3).fold(0, |acc, x| acc + x); |
20 | 29 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `sum()` |
21 | 30 |
|
22 | 31 | error: this `.fold` can be written more succinctly using another method |
23 | | - --> $DIR/unnecessary_fold.rs:12:25 |
| 32 | + --> $DIR/unnecessary_fold.rs:18:25 |
24 | 33 | | |
25 | 34 | LL | let _: i32 = (0..3).fold(1, |acc, x| acc * x); |
26 | 35 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `product()` |
27 | 36 |
|
28 | 37 | error: this `.fold` can be written more succinctly using another method |
29 | | - --> $DIR/unnecessary_fold.rs:17:41 |
| 38 | + --> $DIR/unnecessary_fold.rs:23:41 |
30 | 39 | | |
31 | 40 | LL | let _: bool = (0..3).map(|x| 2 * x).fold(false, |acc, x| acc || x > 2); |
32 | 41 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `any(|x| x > 2)` |
33 | 42 |
|
34 | 43 | error: this `.fold` can be written more succinctly using another method |
35 | | - --> $DIR/unnecessary_fold.rs:47:10 |
| 44 | + --> $DIR/unnecessary_fold.rs:53:10 |
36 | 45 | | |
37 | 46 | LL | .fold(false, |acc, x| acc || x > 2); |
38 | 47 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `any(|x| x > 2)` |
39 | 48 |
|
40 | 49 | error: this `.fold` can be written more succinctly using another method |
41 | | - --> $DIR/unnecessary_fold.rs:58:33 |
| 50 | + --> $DIR/unnecessary_fold.rs:64:33 |
42 | 51 | | |
43 | 52 | LL | assert_eq!(map.values().fold(0, |x, y| x + y), 0); |
44 | 53 | | ^^^^^^^^^^^^^^^^^^^^^ help: try: `sum::<i32>()` |
45 | 54 |
|
46 | 55 | error: this `.fold` can be written more succinctly using another method |
47 | | - --> $DIR/unnecessary_fold.rs:61:30 |
| 56 | + --> $DIR/unnecessary_fold.rs:67:30 |
48 | 57 | | |
49 | 58 | LL | let _ = map.values().fold(0, |x, y| x + y); |
50 | 59 | | ^^^^^^^^^^^^^^^^^^^^^ help: try: `sum::<i32>()` |
51 | 60 |
|
52 | 61 | error: this `.fold` can be written more succinctly using another method |
53 | | - --> $DIR/unnecessary_fold.rs:62:30 |
| 62 | + --> $DIR/unnecessary_fold.rs:68:30 |
54 | 63 | | |
55 | 64 | LL | let _ = map.values().fold(1, |x, y| x * y); |
56 | 65 | | ^^^^^^^^^^^^^^^^^^^^^ help: try: `product::<i32>()` |
57 | 66 |
|
58 | 67 | error: this `.fold` can be written more succinctly using another method |
59 | | - --> $DIR/unnecessary_fold.rs:63:35 |
| 68 | + --> $DIR/unnecessary_fold.rs:69:35 |
60 | 69 | | |
61 | 70 | LL | let _: i32 = map.values().fold(0, |x, y| x + y); |
62 | 71 | | ^^^^^^^^^^^^^^^^^^^^^ help: try: `sum()` |
63 | 72 |
|
64 | 73 | error: this `.fold` can be written more succinctly using another method |
65 | | - --> $DIR/unnecessary_fold.rs:64:35 |
| 74 | + --> $DIR/unnecessary_fold.rs:70:35 |
66 | 75 | | |
67 | 76 | LL | let _: i32 = map.values().fold(1, |x, y| x * y); |
68 | 77 | | ^^^^^^^^^^^^^^^^^^^^^ help: try: `product()` |
69 | 78 |
|
70 | 79 | error: this `.fold` can be written more succinctly using another method |
71 | | - --> $DIR/unnecessary_fold.rs:65:31 |
| 80 | + --> $DIR/unnecessary_fold.rs:71:31 |
72 | 81 | | |
73 | 82 | LL | anything(map.values().fold(0, |x, y| x + y)); |
74 | 83 | | ^^^^^^^^^^^^^^^^^^^^^ help: try: `sum::<i32>()` |
75 | 84 |
|
76 | 85 | error: this `.fold` can be written more succinctly using another method |
77 | | - --> $DIR/unnecessary_fold.rs:66:31 |
| 86 | + --> $DIR/unnecessary_fold.rs:72:31 |
78 | 87 | | |
79 | 88 | LL | anything(map.values().fold(1, |x, y| x * y)); |
80 | 89 | | ^^^^^^^^^^^^^^^^^^^^^ help: try: `product::<i32>()` |
81 | 90 |
|
82 | 91 | error: this `.fold` can be written more succinctly using another method |
83 | | - --> $DIR/unnecessary_fold.rs:67:26 |
| 92 | + --> $DIR/unnecessary_fold.rs:73:26 |
84 | 93 | | |
85 | 94 | LL | num(map.values().fold(0, |x, y| x + y)); |
86 | 95 | | ^^^^^^^^^^^^^^^^^^^^^ help: try: `sum()` |
87 | 96 |
|
88 | 97 | error: this `.fold` can be written more succinctly using another method |
89 | | - --> $DIR/unnecessary_fold.rs:68:26 |
| 98 | + --> $DIR/unnecessary_fold.rs:74:26 |
90 | 99 | | |
91 | 100 | LL | num(map.values().fold(1, |x, y| x * y)); |
92 | 101 | | ^^^^^^^^^^^^^^^^^^^^^ help: try: `product()` |
93 | 102 |
|
94 | | -error: aborting due to 15 previous errors |
| 103 | +error: aborting due to 16 previous errors |
95 | 104 |
|
0 commit comments