2020-01-06 00:36:33 -06:00
|
|
|
error: called `map(f).unwrap_or_else(g)` on a `Result` value. This can be done more directly by calling `.map_or_else(g, f)` instead
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/result_map_unwrap_or_else.rs:15:13
|
2019-01-02 00:23:00 -06:00
|
|
|
|
|
2019-01-02 15:48:44 -06:00
|
|
|
LL | let _ = res.map(|x| x + 1).unwrap_or_else(|e| 0); // should lint even though this call is on a separate line
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2019-01-02 00:23:00 -06:00
|
|
|
|
|
|
|
|
= note: `-D clippy::result-map-unwrap-or-else` implied by `-D warnings`
|
2019-11-26 08:14:28 -06:00
|
|
|
= note: replace `map(|x| x + 1).unwrap_or_else(|e| 0)` with `map_or_else(|e| 0, |x| x + 1)`
|
2019-01-02 00:23:00 -06:00
|
|
|
|
2020-01-06 00:36:33 -06:00
|
|
|
error: called `map(f).unwrap_or_else(g)` on a `Result` value. This can be done more directly by calling `.map_or_else(g, f)` instead
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/result_map_unwrap_or_else.rs:17:13
|
2019-01-02 00:23:00 -06:00
|
|
|
|
|
2019-01-02 15:48:44 -06:00
|
|
|
LL | let _ = res.map(|x| x + 1).unwrap_or_else(|e| 0);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2019-11-26 08:14:28 -06:00
|
|
|
= note: replace `map(|x| x + 1).unwrap_or_else(|e| 0)` with `map_or_else(|e| 0, |x| x + 1)`
|
2019-01-02 00:23:00 -06:00
|
|
|
|
2020-01-06 00:36:33 -06:00
|
|
|
error: called `map(f).unwrap_or_else(g)` on a `Result` value. This can be done more directly by calling `.map_or_else(g, f)` instead
|
2019-01-07 15:33:18 -06:00
|
|
|
--> $DIR/result_map_unwrap_or_else.rs:18:13
|
2019-01-02 00:23:00 -06:00
|
|
|
|
|
2019-01-02 15:48:44 -06:00
|
|
|
LL | let _ = res.map(|x| x + 1).unwrap_or_else(|e| 0);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2019-11-26 08:14:28 -06:00
|
|
|
= note: replace `map(|x| x + 1).unwrap_or_else(|e| 0)` with `map_or_else(|e| 0, |x| x + 1)`
|
2019-01-02 00:23:00 -06:00
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
|