mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-10 15:14:29 +00:00
28 lines
1.3 KiB
Text
28 lines
1.3 KiB
Text
error: usage of `Iterator::fold` on a type that implements `Try`
|
|
--> $DIR/manual_try_fold.rs:59:10
|
|
|
|
|
LL | .fold(Some(0i32), |sum, i| sum?.checked_add(*i))
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `try_fold` instead: `try_fold(0i32, |sum, i| ...)`
|
|
|
|
|
= note: `-D clippy::manual-try-fold` implied by `-D warnings`
|
|
|
|
error: usage of `Iterator::fold` on a type that implements `Try`
|
|
--> $DIR/manual_try_fold.rs:63:10
|
|
|
|
|
LL | .fold(NotOption(0i32, 0i32), |sum, i| NotOption(0i32, 0i32));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `try_fold` instead: `try_fold(..., |sum, i| ...)`
|
|
|
|
error: usage of `Iterator::fold` on a type that implements `Try`
|
|
--> $DIR/manual_try_fold.rs:66:10
|
|
|
|
|
LL | .fold(NotOptionButWorse(0i32), |sum, i| NotOptionButWorse(0i32));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `try_fold` instead: `try_fold(0i32, |sum, i| ...)`
|
|
|
|
error: usage of `Iterator::fold` on a type that implements `Try`
|
|
--> $DIR/manual_try_fold.rs:96:10
|
|
|
|
|
LL | .fold(Some(0i32), |sum, i| sum?.checked_add(*i))
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `try_fold` instead: `try_fold(0i32, |sum, i| ...)`
|
|
|
|
error: aborting due to 4 previous errors
|
|
|