]>
Commit | Line | Data |
---|---|---|
f20569fa XL |
1 | error: called `map(<f>).unwrap_or_else(<g>)` on an `Option` value. This can be done more directly by calling `map_or_else(<g>, <f>)` instead |
2 | --> $DIR/map_unwrap_or_fixable.rs:17:13 | |
3 | | | |
4 | LL | let _ = opt.map(|x| x + 1) | |
5 | | _____________^ | |
6 | LL | | // Should lint even though this call is on a separate line. | |
7 | LL | | .unwrap_or_else(|| 0); | |
8 | | |_____________________________^ help: try this: `opt.map_or_else(|| 0, |x| x + 1)` | |
9 | | | |
10 | = note: `-D clippy::map-unwrap-or` implied by `-D warnings` | |
11 | ||
12 | 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 | |
13 | --> $DIR/map_unwrap_or_fixable.rs:47:13 | |
14 | | | |
15 | LL | let _ = res.map(|x| x + 1) | |
16 | | _____________^ | |
17 | LL | | // should lint even though this call is on a separate line | |
18 | LL | | .unwrap_or_else(|_e| 0); | |
19 | | |_______________________________^ help: try this: `res.map_or_else(|_e| 0, |x| x + 1)` | |
20 | ||
21 | error: aborting due to 2 previous errors | |
22 |