]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/unnecessary_fold.stderr
New upstream version 1.52.1+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / unnecessary_fold.stderr
CommitLineData
f20569fa
XL
1error: this `.fold` can be written more succinctly using another method
2 --> $DIR/unnecessary_fold.rs:8:20
3 |
4LL | let _ = (0..3).fold(false, |acc, x| acc || x > 2);
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `any(|x| x > 2)`
6 |
7 = note: `-D clippy::unnecessary-fold` implied by `-D warnings`
8
9error: this `.fold` can be written more succinctly using another method
10 --> $DIR/unnecessary_fold.rs:10:20
11 |
12LL | let _ = (0..3).fold(true, |acc, x| acc && x > 2);
13 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `all(|x| x > 2)`
14
15error: this `.fold` can be written more succinctly using another method
16 --> $DIR/unnecessary_fold.rs:12:25
17 |
18LL | let _: i32 = (0..3).fold(0, |acc, x| acc + x);
19 | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `sum()`
20
21error: this `.fold` can be written more succinctly using another method
22 --> $DIR/unnecessary_fold.rs:14:25
23 |
24LL | let _: i32 = (0..3).fold(1, |acc, x| acc * x);
25 | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `product()`
26
27error: this `.fold` can be written more succinctly using another method
28 --> $DIR/unnecessary_fold.rs:19:41
29 |
30LL | let _: bool = (0..3).map(|x| 2 * x).fold(false, |acc, x| acc || x > 2);
31 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `any(|x| x > 2)`
32
33error: this `.fold` can be written more succinctly using another method
34 --> $DIR/unnecessary_fold.rs:49:10
35 |
36LL | .fold(false, |acc, x| acc || x > 2);
37 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `any(|x| x > 2)`
38
39error: aborting due to 6 previous errors
40