@@ -131,80 +131,10 @@ LL | x.field.map(|value| { { plus_one(value + captured); } });
131131error: called `map(f)` on an Option value where `f` is a unit closure
132132 --> $DIR/option_map_unit_fn_fixable.rs:74:5
133133 |
134- LL | x.field.map(|ref value| { do_nothing(value + captured) });
134+ LL | x.field.map(|ref value| { do_nothing(value + captured) });}
135135 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
136136 | |
137137 | help: try this: `if let Some(ref value) = x.field { do_nothing(value + captured) }`
138138
139- error: called `map(f)` on an Option value where `f` is a unit closure
140- --> $DIR/option_map_unit_fn_fixable.rs:77:5
141- |
142- LL | x.field.map(|value| { do_nothing(value); do_nothing(value) });
143- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
144- | |
145- | help: try this: `if let Some(value) = x.field { ... }`
146-
147- error: called `map(f)` on an Option value where `f` is a unit closure
148- --> $DIR/option_map_unit_fn_fixable.rs:79:5
149- |
150- LL | x.field.map(|value| if value > 0 { do_nothing(value); do_nothing(value) });
151- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
152- | |
153- | help: try this: `if let Some(value) = x.field { ... }`
154-
155- error: called `map(f)` on an Option value where `f` is a unit closure
156- --> $DIR/option_map_unit_fn_fixable.rs:83:5
157- |
158- LL | x.field.map(|value| {
159- | _____^
160- | |_____|
161- | ||
162- LL | || do_nothing(value);
163- LL | || do_nothing(value)
164- LL | || });
165- | ||______^- help: try this: `if let Some(value) = x.field { ... }`
166- | |_______|
167- |
168-
169- error: called `map(f)` on an Option value where `f` is a unit closure
170- --> $DIR/option_map_unit_fn_fixable.rs:87:5
171- |
172- LL | x.field.map(|value| { do_nothing(value); do_nothing(value); });
173- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
174- | |
175- | help: try this: `if let Some(value) = x.field { ... }`
176-
177- error: called `map(f)` on an Option value where `f` is a unit function
178- --> $DIR/option_map_unit_fn_fixable.rs:90:5
179- |
180- LL | Some(42).map(diverge);
181- | ^^^^^^^^^^^^^^^^^^^^^-
182- | |
183- | help: try this: `if let Some(_) = Some(42) { diverge(...) }`
184-
185- error: called `map(f)` on an Option value where `f` is a unit function
186- --> $DIR/option_map_unit_fn_fixable.rs:91:5
187- |
188- LL | "12".parse::<i32>().ok().map(diverge);
189- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
190- | |
191- | help: try this: `if let Some(_) = "12".parse::<i32>().ok() { diverge(...) }`
192-
193- error: called `map(f)` on an Option value where `f` is a unit function
194- --> $DIR/option_map_unit_fn_fixable.rs:92:5
195- |
196- LL | Some(plus_one(1)).map(do_nothing);
197- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
198- | |
199- | help: try this: `if let Some(_) = Some(plus_one(1)) { do_nothing(...) }`
200-
201- error: called `map(f)` on an Option value where `f` is a unit function
202- --> $DIR/option_map_unit_fn_fixable.rs:96:5
203- |
204- LL | y.map(do_nothing);
205- | ^^^^^^^^^^^^^^^^^-
206- | |
207- | help: try this: `if let Some(_y) = y { do_nothing(...) }`
208-
209- error: aborting due to 25 previous errors
139+ error: aborting due to 17 previous errors
210140
0 commit comments