rust-clippy/tests/ui/manual_try_fold.stderr

29 lines
1.4 KiB
Text
Raw Normal View History

2023-06-23 10:43:53 +00:00
error: you seem to be using `Iterator::fold` on a type that implements `Try`
--> $DIR/manual_try_fold.rs:61:10
|
LL | .fold(Some(0i32), |sum, i| sum?.checked_add(*i))
2023-06-25 14:01:06 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `try_fold` instead: `try_fold(0i32, |sum, i| ...)`
2023-06-23 10:43:53 +00:00
|
= note: `-D clippy::manual-try-fold` implied by `-D warnings`
error: you seem to be using `Iterator::fold` on a type that implements `Try`
--> $DIR/manual_try_fold.rs:65:10
|
LL | .fold(NotOption(0i32, 0i32), |sum, i| NotOption(0i32, 0i32));
2023-06-25 14:01:06 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `try_fold` instead: `try_fold(..., |sum, i| ...)`
2023-06-23 10:43:53 +00:00
error: you seem to be using `Iterator::fold` on a type that implements `Try`
--> $DIR/manual_try_fold.rs:68:10
|
LL | .fold(NotOptionButWorse(0i32), |sum, i| NotOptionButWorse(0i32));
2023-06-25 14:01:06 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `try_fold` instead: `try_fold(0i32, |sum, i| ...)`
2023-06-23 10:43:53 +00:00
2023-06-23 10:48:59 +00:00
error: you seem to be using `Iterator::fold` on a type that implements `Try`
--> $DIR/manual_try_fold.rs:98:10
|
LL | .fold(Some(0i32), |sum, i| sum?.checked_add(*i))
2023-06-25 14:01:06 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `try_fold` instead: `try_fold(0i32, |sum, i| ...)`
2023-06-23 10:48:59 +00:00
error: aborting due to 4 previous errors
2023-06-23 10:43:53 +00:00