1 error: called `map(<f>).unwrap_or(<a>)` on an `Option` value. This can be done more directly by calling `map_or(<a>, <f>)` instead
2 --> $DIR/map_unwrap_or.rs:16:13
4 LL | let _ = opt.map(|x| x + 1)
6 LL | | // Should lint even though this call is on a separate line.
8 | |_____________________^
10 = note: `-D clippy::map-unwrap-or` implied by `-D warnings`
11 help: use `map_or(<a>, <f>)` instead
13 LL | let _ = opt.map_or(0, |x| x + 1);
16 error: called `map(<f>).unwrap_or(<a>)` on an `Option` value. This can be done more directly by calling `map_or(<a>, <f>)` instead
17 --> $DIR/map_unwrap_or.rs:20:13
19 LL | let _ = opt.map(|x| {
23 LL | | ).unwrap_or(0);
24 | |__________________^
26 help: use `map_or(<a>, <f>)` instead
28 LL | let _ = opt.map_or(0, |x| {
34 error: called `map(<f>).unwrap_or(<a>)` on an `Option` value. This can be done more directly by calling `map_or(<a>, <f>)` instead
35 --> $DIR/map_unwrap_or.rs:24:13
37 LL | let _ = opt.map(|x| x + 1)
44 help: use `map_or(<a>, <f>)` instead
46 LL | let _ = opt.map_or({
51 error: called `map(<f>).unwrap_or(None)` on an `Option` value. This can be done more directly by calling `and_then(<f>)` instead
52 --> $DIR/map_unwrap_or.rs:29:13
54 LL | let _ = opt.map(|x| Some(x + 1)).unwrap_or(None);
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
57 help: use `and_then(<f>)` instead
59 LL | let _ = opt.and_then(|x| Some(x + 1));
62 error: called `map(<f>).unwrap_or(None)` on an `Option` value. This can be done more directly by calling `and_then(<f>)` instead
63 --> $DIR/map_unwrap_or.rs:31:13
65 LL | let _ = opt.map(|x| {
69 LL | | ).unwrap_or(None);
70 | |_____________________^
72 help: use `and_then(<f>)` instead
74 LL | let _ = opt.and_then(|x| {
80 error: called `map(<f>).unwrap_or(None)` on an `Option` value. This can be done more directly by calling `and_then(<f>)` instead
81 --> $DIR/map_unwrap_or.rs:35:13
85 LL | | .map(|x| Some(x + 1))
86 LL | | .unwrap_or(None);
87 | |________________________^
89 help: use `and_then(<f>)` instead
91 LL | .and_then(|x| Some(x + 1));
94 error: called `map(<f>).unwrap_or(<a>)` on an `Option` value. This can be done more directly by calling `map_or(<a>, <f>)` instead
95 --> $DIR/map_unwrap_or.rs:46:13
97 LL | let _ = Some("prefix").map(|p| format!("{}.", p)).unwrap_or(id);
98 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
100 help: use `map_or(<a>, <f>)` instead
102 LL | let _ = Some("prefix").map_or(id, |p| format!("{}.", p));
105 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
106 --> $DIR/map_unwrap_or.rs:50:13
108 LL | let _ = opt.map(|x| {
112 LL | | ).unwrap_or_else(|| 0);
113 | |__________________________^
115 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
116 --> $DIR/map_unwrap_or.rs:54:13
118 LL | let _ = opt.map(|x| x + 1)
120 LL | | .unwrap_or_else(||
125 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
126 --> $DIR/map_unwrap_or.rs:66:13
128 LL | let _ = res.map(|x| {
132 LL | | ).unwrap_or_else(|_e| 0);
133 | |____________________________^
135 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
136 --> $DIR/map_unwrap_or.rs:70:13
138 LL | let _ = res.map(|x| x + 1)
140 LL | | .unwrap_or_else(|_e| {
145 error: aborting due to 11 previous errors