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