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