2018-04-12 20:16:43 +00:00
|
|
|
error: this `.fold` can be written more succinctly using another method
|
2024-02-08 19:24:42 +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(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`
|
2023-08-01 12:02:21 +00:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::unnecessary_fold)]`
|
2018-04-12 20:16:43 +00:00
|
|
|
|
2024-02-08 19:24:42 +00:00
|
|
|
error: redundant closure
|
|
|
|
--> $DIR/unnecessary_fold.rs:12:32
|
|
|
|
|
|
|
|
|
LL | let _ = (0..3).fold(false, |acc, x| is_any(acc, x));
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `is_any`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::redundant-closure` implied by `-D warnings`
|
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::redundant_closure)]`
|
|
|
|
|
2018-04-12 20:16:43 +00:00
|
|
|
error: this `.fold` can be written more succinctly using another method
|
2024-02-08 19:24:42 +00:00
|
|
|
--> $DIR/unnecessary_fold.rs:14: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)`
|
2018-04-12 20:16:43 +00:00
|
|
|
|
|
|
|
error: this `.fold` can be written more succinctly using another method
|
2024-02-08 19:24:42 +00:00
|
|
|
--> $DIR/unnecessary_fold.rs:16: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()`
|
2018-04-12 20:16:43 +00:00
|
|
|
|
|
|
|
error: this `.fold` can be written more succinctly using another method
|
2024-02-08 19:24:42 +00:00
|
|
|
--> $DIR/unnecessary_fold.rs:18:25
|
2018-04-12 20:16:43 +00:00
|
|
|
|
|
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()`
|
2018-04-12 20:16:43 +00:00
|
|
|
|
|
|
|
error: this `.fold` can be written more succinctly using another method
|
2024-02-08 19:24:42 +00:00
|
|
|
--> $DIR/unnecessary_fold.rs:23:41
|
2018-04-12 20:16:43 +00:00
|
|
|
|
|
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)`
|
2018-04-12 20:16:43 +00:00
|
|
|
|
2019-08-14 17:34:50 +00:00
|
|
|
error: this `.fold` can be written more succinctly using another method
|
2024-02-08 19:24:42 +00:00
|
|
|
--> $DIR/unnecessary_fold.rs:53:10
|
2019-08-14 17:34:50 +00:00
|
|
|
|
|
|
|
|
LL | .fold(false, |acc, x| acc || x > 2);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `any(|x| x > 2)`
|
|
|
|
|
2023-07-02 12:35:19 +00:00
|
|
|
error: this `.fold` can be written more succinctly using another method
|
2024-02-08 19:24:42 +00:00
|
|
|
--> $DIR/unnecessary_fold.rs:64:33
|
2023-07-02 12:35:19 +00:00
|
|
|
|
|
|
|
|
LL | assert_eq!(map.values().fold(0, |x, y| x + y), 0);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `sum::<i32>()`
|
|
|
|
|
|
|
|
error: this `.fold` can be written more succinctly using another method
|
2024-02-08 19:24:42 +00:00
|
|
|
--> $DIR/unnecessary_fold.rs:67:30
|
2023-07-02 12:35:19 +00:00
|
|
|
|
|
|
|
|
LL | let _ = map.values().fold(0, |x, y| x + y);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `sum::<i32>()`
|
|
|
|
|
|
|
|
error: this `.fold` can be written more succinctly using another method
|
2024-02-08 19:24:42 +00:00
|
|
|
--> $DIR/unnecessary_fold.rs:68:30
|
2023-07-02 12:35:19 +00:00
|
|
|
|
|
|
|
|
LL | let _ = map.values().fold(1, |x, y| x * y);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `product::<i32>()`
|
|
|
|
|
|
|
|
error: this `.fold` can be written more succinctly using another method
|
2024-02-08 19:24:42 +00:00
|
|
|
--> $DIR/unnecessary_fold.rs:69:35
|
2023-07-02 12:35:19 +00:00
|
|
|
|
|
|
|
|
LL | let _: i32 = map.values().fold(0, |x, y| x + y);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `sum()`
|
|
|
|
|
|
|
|
error: this `.fold` can be written more succinctly using another method
|
2024-02-08 19:24:42 +00:00
|
|
|
--> $DIR/unnecessary_fold.rs:70:35
|
2023-07-02 12:35:19 +00:00
|
|
|
|
|
|
|
|
LL | let _: i32 = map.values().fold(1, |x, y| x * y);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `product()`
|
|
|
|
|
|
|
|
error: this `.fold` can be written more succinctly using another method
|
2024-02-08 19:24:42 +00:00
|
|
|
--> $DIR/unnecessary_fold.rs:71:31
|
2023-07-02 12:35:19 +00:00
|
|
|
|
|
|
|
|
LL | anything(map.values().fold(0, |x, y| x + y));
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `sum::<i32>()`
|
|
|
|
|
|
|
|
error: this `.fold` can be written more succinctly using another method
|
2024-02-08 19:24:42 +00:00
|
|
|
--> $DIR/unnecessary_fold.rs:72:31
|
2023-07-02 12:35:19 +00:00
|
|
|
|
|
|
|
|
LL | anything(map.values().fold(1, |x, y| x * y));
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `product::<i32>()`
|
|
|
|
|
|
|
|
error: this `.fold` can be written more succinctly using another method
|
2024-02-08 19:24:42 +00:00
|
|
|
--> $DIR/unnecessary_fold.rs:73:26
|
2023-07-02 12:35:19 +00:00
|
|
|
|
|
|
|
|
LL | num(map.values().fold(0, |x, y| x + y));
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `sum()`
|
|
|
|
|
|
|
|
error: this `.fold` can be written more succinctly using another method
|
2024-02-08 19:24:42 +00:00
|
|
|
--> $DIR/unnecessary_fold.rs:74:26
|
2023-07-02 12:35:19 +00:00
|
|
|
|
|
|
|
|
LL | num(map.values().fold(1, |x, y| x * y));
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `product()`
|
|
|
|
|
2024-02-08 19:24:42 +00:00
|
|
|
error: aborting due to 16 previous errors
|
2018-04-12 20:16:43 +00:00
|
|
|
|