1 error: called `map(f)` on an Option value where `f` is a unit function
2 --> $DIR/option_map_unit_fn.rs:41:5
4 41 | x.field.map(do_nothing);
5 | ^^^^^^^^^^^^^^^^^^^^^^^-
7 | help: try this: `if let Some(x_field) = x.field { do_nothing(...) }`
9 = note: `-D clippy::option-map-unit-fn` implied by `-D warnings`
11 error: called `map(f)` on an Option value where `f` is a unit function
12 --> $DIR/option_map_unit_fn.rs:43:5
14 43 | x.field.map(do_nothing);
15 | ^^^^^^^^^^^^^^^^^^^^^^^-
17 | help: try this: `if let Some(x_field) = x.field { do_nothing(...) }`
19 error: called `map(f)` on an Option value where `f` is a unit function
20 --> $DIR/option_map_unit_fn.rs:45:5
22 45 | x.field.map(diverge);
23 | ^^^^^^^^^^^^^^^^^^^^-
25 | help: try this: `if let Some(x_field) = x.field { diverge(...) }`
27 error: called `map(f)` on an Option value where `f` is a unit closure
28 --> $DIR/option_map_unit_fn.rs:51:5
30 51 | x.field.map(|value| x.do_option_nothing(value + captured));
31 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
33 | help: try this: `if let Some(value) = x.field { x.do_option_nothing(value + captured) }`
35 error: called `map(f)` on an Option value where `f` is a unit closure
36 --> $DIR/option_map_unit_fn.rs:53:5
38 53 | x.field.map(|value| { x.do_option_plus_one(value + captured); });
39 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
41 | help: try this: `if let Some(value) = x.field { x.do_option_plus_one(value + captured); }`
43 error: called `map(f)` on an Option value where `f` is a unit closure
44 --> $DIR/option_map_unit_fn.rs:56:5
46 56 | x.field.map(|value| do_nothing(value + captured));
47 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
49 | help: try this: `if let Some(value) = x.field { do_nothing(value + captured) }`
51 error: called `map(f)` on an Option value where `f` is a unit closure
52 --> $DIR/option_map_unit_fn.rs:58:5
54 58 | x.field.map(|value| { do_nothing(value + captured) });
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
57 | help: try this: `if let Some(value) = x.field { do_nothing(value + captured) }`
59 error: called `map(f)` on an Option value where `f` is a unit closure
60 --> $DIR/option_map_unit_fn.rs:60:5
62 60 | x.field.map(|value| { do_nothing(value + captured); });
63 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
65 | help: try this: `if let Some(value) = x.field { do_nothing(value + captured); }`
67 error: called `map(f)` on an Option value where `f` is a unit closure
68 --> $DIR/option_map_unit_fn.rs:62:5
70 62 | x.field.map(|value| { { do_nothing(value + captured); } });
71 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
73 | help: try this: `if let Some(value) = x.field { do_nothing(value + captured); }`
75 error: called `map(f)` on an Option value where `f` is a unit closure
76 --> $DIR/option_map_unit_fn.rs:65:5
78 65 | x.field.map(|value| diverge(value + captured));
79 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
81 | help: try this: `if let Some(value) = x.field { diverge(value + captured) }`
83 error: called `map(f)` on an Option value where `f` is a unit closure
84 --> $DIR/option_map_unit_fn.rs:67:5
86 67 | x.field.map(|value| { diverge(value + captured) });
87 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
89 | help: try this: `if let Some(value) = x.field { diverge(value + captured) }`
91 error: called `map(f)` on an Option value where `f` is a unit closure
92 --> $DIR/option_map_unit_fn.rs:69:5
94 69 | x.field.map(|value| { diverge(value + captured); });
95 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
97 | help: try this: `if let Some(value) = x.field { diverge(value + captured); }`
99 error: called `map(f)` on an Option value where `f` is a unit closure
100 --> $DIR/option_map_unit_fn.rs:71:5
102 71 | x.field.map(|value| { { diverge(value + captured); } });
103 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
105 | help: try this: `if let Some(value) = x.field { diverge(value + captured); }`
107 error: called `map(f)` on an Option value where `f` is a unit closure
108 --> $DIR/option_map_unit_fn.rs:76:5
110 76 | x.field.map(|value| { let y = plus_one(value + captured); });
111 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
113 | help: try this: `if let Some(value) = x.field { let y = plus_one(value + captured); }`
115 error: called `map(f)` on an Option value where `f` is a unit closure
116 --> $DIR/option_map_unit_fn.rs:78:5
118 78 | x.field.map(|value| { plus_one(value + captured); });
119 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
121 | help: try this: `if let Some(value) = x.field { plus_one(value + captured); }`
123 error: called `map(f)` on an Option value where `f` is a unit closure
124 --> $DIR/option_map_unit_fn.rs:80:5
126 80 | x.field.map(|value| { { plus_one(value + captured); } });
127 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
129 | help: try this: `if let Some(value) = x.field { plus_one(value + captured); }`
131 error: called `map(f)` on an Option value where `f` is a unit closure
132 --> $DIR/option_map_unit_fn.rs:83:5
134 83 | x.field.map(|ref value| { do_nothing(value + captured) });
135 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
137 | help: try this: `if let Some(ref value) = x.field { do_nothing(value + captured) }`
139 error: called `map(f)` on an Option value where `f` is a unit closure
140 --> $DIR/option_map_unit_fn.rs:86:5
142 86 | x.field.map(|value| { do_nothing(value); do_nothing(value) });
143 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
145 | help: try this: `if let Some(value) = x.field { ... }`
147 error: called `map(f)` on an Option value where `f` is a unit closure
148 --> $DIR/option_map_unit_fn.rs:88:5
150 88 | x.field.map(|value| if value > 0 { do_nothing(value); do_nothing(value) });
151 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
153 | help: try this: `if let Some(value) = x.field { ... }`
155 error: called `map(f)` on an Option value where `f` is a unit closure
156 --> $DIR/option_map_unit_fn.rs:92:5
158 92 | x.field.map(|value| {
162 93 | || do_nothing(value);
163 94 | || do_nothing(value)
165 | ||______^- help: try this: `if let Some(value) = x.field { ... }`
169 error: called `map(f)` on an Option value where `f` is a unit closure
170 --> $DIR/option_map_unit_fn.rs:96:5
172 96 | x.field.map(|value| { do_nothing(value); do_nothing(value); });
173 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
175 | help: try this: `if let Some(value) = x.field { ... }`
177 error: called `map(f)` on an Option value where `f` is a unit function
178 --> $DIR/option_map_unit_fn.rs:99:5
180 99 | Some(42).map(diverge);
181 | ^^^^^^^^^^^^^^^^^^^^^-
183 | help: try this: `if let Some(_) = Some(42) { diverge(...) }`
185 error: called `map(f)` on an Option value where `f` is a unit function
186 --> $DIR/option_map_unit_fn.rs:100:5
188 100 | "12".parse::<i32>().ok().map(diverge);
189 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
191 | help: try this: `if let Some(_) = "12".parse::<i32>().ok() { diverge(...) }`
193 error: called `map(f)` on an Option value where `f` is a unit function
194 --> $DIR/option_map_unit_fn.rs:101:5
196 101 | Some(plus_one(1)).map(do_nothing);
197 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
199 | help: try this: `if let Some(_) = Some(plus_one(1)) { do_nothing(...) }`
201 error: called `map(f)` on an Option value where `f` is a unit function
202 --> $DIR/option_map_unit_fn.rs:105:5
204 105 | y.map(do_nothing);
207 | help: try this: `if let Some(_y) = y { do_nothing(...) }`
209 error: aborting due to 25 previous errors