summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/map_unwrap_or_fixable.stderr
blob: d1a9fdd6ecffdbc33a3e70906ed61bda50e70cd7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
error: called `map(<f>).unwrap_or_else(<g>)` on an `Option` value
  --> $DIR/map_unwrap_or_fixable.rs:16:13
   |
LL |       let _ = opt.map(|x| x + 1)
   |  _____________^
LL | |         // Should lint even though this call is on a separate line.
LL | |         .unwrap_or_else(|| 0);
   | |_____________________________^ help: try: `opt.map_or_else(|| 0, |x| x + 1)`
   |
   = note: `-D clippy::map-unwrap-or` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::map_unwrap_or)]`

error: called `map(<f>).unwrap_or_else(<g>)` on a `Result` value
  --> $DIR/map_unwrap_or_fixable.rs:46:13
   |
LL |       let _ = res.map(|x| x + 1)
   |  _____________^
LL | |         // should lint even though this call is on a separate line
LL | |         .unwrap_or_else(|_e| 0);
   | |_______________________________^ help: try: `res.map_or_else(|_e| 0, |x| x + 1)`

error: aborting due to 2 previous errors