2018-04-12 15:16:43 -05:00
|
|
|
error: this `.fold` can be written more succinctly using another method
|
2023-07-27 06:40:22 -05:00
|
|
|
--> $DIR/unnecessary_fold.rs:6:20
|
2018-10-06 11:18:06 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | let _ = (0..3).fold(false, |acc, x| acc || x > 2);
|
2019-08-14 12:35:17 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `any(|x| x > 2)`
|
2018-10-06 11:18:06 -05:00
|
|
|
|
|
|
|
|
= note: `-D clippy::unnecessary-fold` implied by `-D warnings`
|
2018-04-12 15:16:43 -05:00
|
|
|
|
|
|
|
error: this `.fold` can be written more succinctly using another method
|
2023-07-27 06:40:22 -05:00
|
|
|
--> $DIR/unnecessary_fold.rs:8:20
|
2018-10-06 11:18:06 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | let _ = (0..3).fold(true, |acc, x| acc && x > 2);
|
2019-08-14 12:35:17 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `all(|x| x > 2)`
|
2018-04-12 15:16:43 -05:00
|
|
|
|
|
|
|
error: this `.fold` can be written more succinctly using another method
|
2023-07-27 06:40:22 -05:00
|
|
|
--> $DIR/unnecessary_fold.rs:10:25
|
2018-10-06 11:18:06 -05:00
|
|
|
|
|
2019-01-13 13:03:22 -06:00
|
|
|
LL | let _: i32 = (0..3).fold(0, |acc, x| acc + x);
|
2019-08-14 12:35:17 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `sum()`
|
2018-04-12 15:16:43 -05:00
|
|
|
|
|
|
|
error: this `.fold` can be written more succinctly using another method
|
2023-07-27 06:40:22 -05:00
|
|
|
--> $DIR/unnecessary_fold.rs:12:25
|
2018-04-12 15:16:43 -05:00
|
|
|
|
|
2019-01-13 13:03:22 -06:00
|
|
|
LL | let _: i32 = (0..3).fold(1, |acc, x| acc * x);
|
2019-08-14 12:35:17 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `product()`
|
2018-04-12 15:16:43 -05:00
|
|
|
|
|
|
|
error: this `.fold` can be written more succinctly using another method
|
2023-07-27 06:40:22 -05:00
|
|
|
--> $DIR/unnecessary_fold.rs:17:41
|
2018-04-12 15:16:43 -05:00
|
|
|
|
|
2019-01-13 13:03:22 -06:00
|
|
|
LL | let _: bool = (0..3).map(|x| 2 * x).fold(false, |acc, x| acc || x > 2);
|
2019-08-14 12:35:17 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `any(|x| x > 2)`
|
2018-04-12 15:16:43 -05:00
|
|
|
|
2019-08-14 12:34:50 -05:00
|
|
|
error: this `.fold` can be written more succinctly using another method
|
2023-07-27 06:40:22 -05:00
|
|
|
--> $DIR/unnecessary_fold.rs:47:10
|
2019-08-14 12:34:50 -05:00
|
|
|
|
|
|
|
|
LL | .fold(false, |acc, x| acc || x > 2);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `any(|x| x > 2)`
|
|
|
|
|
2023-06-11 19:43:23 -05:00
|
|
|
error: this `.fold` can be written more succinctly using another method
|
2023-07-27 06:40:22 -05:00
|
|
|
--> $DIR/unnecessary_fold.rs:58:33
|
2023-06-11 19:43:23 -05: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
|
2023-07-27 06:40:22 -05:00
|
|
|
--> $DIR/unnecessary_fold.rs:61:30
|
2023-06-11 19:43:23 -05: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
|
2023-07-27 06:40:22 -05:00
|
|
|
--> $DIR/unnecessary_fold.rs:62:30
|
2023-06-11 19:43:23 -05: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
|
2023-07-27 06:40:22 -05:00
|
|
|
--> $DIR/unnecessary_fold.rs:63:35
|
2023-06-11 19:43:23 -05: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
|
2023-07-27 06:40:22 -05:00
|
|
|
--> $DIR/unnecessary_fold.rs:64:35
|
2023-06-11 19:43:23 -05: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
|
2023-07-27 06:40:22 -05:00
|
|
|
--> $DIR/unnecessary_fold.rs:65:31
|
2023-06-11 19:43:23 -05: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
|
2023-07-27 06:40:22 -05:00
|
|
|
--> $DIR/unnecessary_fold.rs:66:31
|
2023-06-11 19:43:23 -05: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
|
2023-07-27 06:40:22 -05:00
|
|
|
--> $DIR/unnecessary_fold.rs:67:26
|
2023-06-11 19:43:23 -05: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
|
2023-07-27 06:40:22 -05:00
|
|
|
--> $DIR/unnecessary_fold.rs:68:26
|
2023-06-11 19:43:23 -05:00
|
|
|
|
|
|
|
|
LL | num(map.values().fold(1, |x, y| x * y));
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `product()`
|
|
|
|
|
|
|
|
error: aborting due to 15 previous errors
|
2018-04-12 15:16:43 -05:00
|
|
|
|