]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/map_unwrap_or_fixable.stderr
Update upstream source from tag 'upstream/1.52.1+dfsg1'
[rustc.git] / src / tools / clippy / tests / ui / map_unwrap_or_fixable.stderr
CommitLineData
f20569fa
XL
1error: 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 |
4LL | let _ = opt.map(|x| x + 1)
5 | _____________^
6LL | | // Should lint even though this call is on a separate line.
7LL | | .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
12error: 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 |
15LL | let _ = res.map(|x| x + 1)
16 | _____________^
17LL | | // should lint even though this call is on a separate line
18LL | | .unwrap_or_else(|_e| 0);
19 | |_______________________________^ help: try this: `res.map_or_else(|_e| 0, |x| x + 1)`
20
21error: aborting due to 2 previous errors
22