1 error: this `.fold` can be written more succinctly using another method
2 --> $DIR/unnecessary_fold.rs:6:20
4 LL | let _ = (0..3).fold(false, |acc, x| acc || x > 2);
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `any(|x| x > 2)`
7 = note: `-D clippy::unnecessary-fold` implied by `-D warnings`
8 = help: to override `-D warnings` add `#[allow(clippy::unnecessary_fold)]`
10 error: this `.fold` can be written more succinctly using another method
11 --> $DIR/unnecessary_fold.rs:8:20
13 LL | let _ = (0..3).fold(true, |acc, x| acc && x > 2);
14 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `all(|x| x > 2)`
16 error: this `.fold` can be written more succinctly using another method
17 --> $DIR/unnecessary_fold.rs:10:25
19 LL | let _: i32 = (0..3).fold(0, |acc, x| acc + x);
20 | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `sum()`
22 error: this `.fold` can be written more succinctly using another method
23 --> $DIR/unnecessary_fold.rs:12:25
25 LL | let _: i32 = (0..3).fold(1, |acc, x| acc * x);
26 | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `product()`
28 error: this `.fold` can be written more succinctly using another method
29 --> $DIR/unnecessary_fold.rs:17:41
31 LL | let _: bool = (0..3).map(|x| 2 * x).fold(false, |acc, x| acc || x > 2);
32 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `any(|x| x > 2)`
34 error: this `.fold` can be written more succinctly using another method
35 --> $DIR/unnecessary_fold.rs:47:10
37 LL | .fold(false, |acc, x| acc || x > 2);
38 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `any(|x| x > 2)`
40 error: this `.fold` can be written more succinctly using another method
41 --> $DIR/unnecessary_fold.rs:58:33
43 LL | assert_eq!(map.values().fold(0, |x, y| x + y), 0);
44 | ^^^^^^^^^^^^^^^^^^^^^ help: try: `sum::<i32>()`
46 error: this `.fold` can be written more succinctly using another method
47 --> $DIR/unnecessary_fold.rs:61:30
49 LL | let _ = map.values().fold(0, |x, y| x + y);
50 | ^^^^^^^^^^^^^^^^^^^^^ help: try: `sum::<i32>()`
52 error: this `.fold` can be written more succinctly using another method
53 --> $DIR/unnecessary_fold.rs:62:30
55 LL | let _ = map.values().fold(1, |x, y| x * y);
56 | ^^^^^^^^^^^^^^^^^^^^^ help: try: `product::<i32>()`
58 error: this `.fold` can be written more succinctly using another method
59 --> $DIR/unnecessary_fold.rs:63:35
61 LL | let _: i32 = map.values().fold(0, |x, y| x + y);
62 | ^^^^^^^^^^^^^^^^^^^^^ help: try: `sum()`
64 error: this `.fold` can be written more succinctly using another method
65 --> $DIR/unnecessary_fold.rs:64:35
67 LL | let _: i32 = map.values().fold(1, |x, y| x * y);
68 | ^^^^^^^^^^^^^^^^^^^^^ help: try: `product()`
70 error: this `.fold` can be written more succinctly using another method
71 --> $DIR/unnecessary_fold.rs:65:31
73 LL | anything(map.values().fold(0, |x, y| x + y));
74 | ^^^^^^^^^^^^^^^^^^^^^ help: try: `sum::<i32>()`
76 error: this `.fold` can be written more succinctly using another method
77 --> $DIR/unnecessary_fold.rs:66:31
79 LL | anything(map.values().fold(1, |x, y| x * y));
80 | ^^^^^^^^^^^^^^^^^^^^^ help: try: `product::<i32>()`
82 error: this `.fold` can be written more succinctly using another method
83 --> $DIR/unnecessary_fold.rs:67:26
85 LL | num(map.values().fold(0, |x, y| x + y));
86 | ^^^^^^^^^^^^^^^^^^^^^ help: try: `sum()`
88 error: this `.fold` can be written more succinctly using another method
89 --> $DIR/unnecessary_fold.rs:68:26
91 LL | num(map.values().fold(1, |x, y| x * y));
92 | ^^^^^^^^^^^^^^^^^^^^^ help: try: `product()`
94 error: aborting due to 15 previous errors