2
0
Fork 0
mirror of https://github.com/rust-lang/rust-clippy synced 2024-12-21 02:23:19 +00:00
rust-clippy/tests/ui/unnecessary_fold.stderr

41 lines
1.6 KiB
Text
Raw Normal View History

error: this `.fold` can be written more succinctly using another method
2019-08-14 17:35:17 +00:00
--> $DIR/unnecessary_fold.rs:8:20
2018-10-06 16:18:06 +00:00
|
2018-12-27 15:57:55 +00:00
LL | let _ = (0..3).fold(false, |acc, x| acc || x > 2);
2019-08-14 17:35:17 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `any(|x| x > 2)`
2018-10-06 16:18:06 +00:00
|
= note: `-D clippy::unnecessary-fold` implied by `-D warnings`
error: this `.fold` can be written more succinctly using another method
2019-08-14 17:35:17 +00:00
--> $DIR/unnecessary_fold.rs:10:20
2018-10-06 16:18:06 +00:00
|
2018-12-27 15:57:55 +00:00
LL | let _ = (0..3).fold(true, |acc, x| acc && x > 2);
2019-08-14 17:35:17 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `all(|x| x > 2)`
error: this `.fold` can be written more succinctly using another method
2019-08-14 17:35:17 +00:00
--> $DIR/unnecessary_fold.rs:12:25
2018-10-06 16:18:06 +00:00
|
2019-01-13 19:03:22 +00:00
LL | let _: i32 = (0..3).fold(0, |acc, x| acc + x);
2019-08-14 17:35:17 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `sum()`
error: this `.fold` can be written more succinctly using another method
2019-08-14 17:35:17 +00:00
--> $DIR/unnecessary_fold.rs:14:25
|
2019-01-13 19:03:22 +00:00
LL | let _: i32 = (0..3).fold(1, |acc, x| acc * x);
2019-08-14 17:35:17 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `product()`
error: this `.fold` can be written more succinctly using another method
2019-08-14 17:35:17 +00:00
--> $DIR/unnecessary_fold.rs:19:41
|
2019-01-13 19:03:22 +00:00
LL | let _: bool = (0..3).map(|x| 2 * x).fold(false, |acc, x| acc || x > 2);
2019-08-14 17:35:17 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `any(|x| x > 2)`
2019-08-14 17:34:50 +00:00
error: this `.fold` can be written more succinctly using another method
--> $DIR/unnecessary_fold.rs:49:10
|
LL | .fold(false, |acc, x| acc || x > 2);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `any(|x| x > 2)`
error: aborting due to 6 previous errors