1- error: called `map(f)` on an `Result` value where `f` is a function that returns the unit type `()`
1+ error: called `map(f)` on a `Result` value where `f` is a function that returns the unit type `()`
22 --> tests/ui/result_map_unit_fn_fixable.rs:32:5
33 |
44LL | x.field.map(do_nothing);
@@ -12,7 +12,7 @@ LL - x.field.map(do_nothing);
1212LL + if let Ok(x_field) = x.field { do_nothing(x_field) }
1313 |
1414
15- error: called `map(f)` on an `Result` value where `f` is a function that returns the unit type `()`
15+ error: called `map(f)` on a `Result` value where `f` is a function that returns the unit type `()`
1616 --> tests/ui/result_map_unit_fn_fixable.rs:35:5
1717 |
1818LL | x.field.map(do_nothing);
@@ -24,7 +24,7 @@ LL - x.field.map(do_nothing);
2424LL + if let Ok(x_field) = x.field { do_nothing(x_field) }
2525 |
2626
27- error: called `map(f)` on an `Result` value where `f` is a function that returns the unit type `()`
27+ error: called `map(f)` on a `Result` value where `f` is a function that returns the unit type `()`
2828 --> tests/ui/result_map_unit_fn_fixable.rs:38:5
2929 |
3030LL | x.field.map(diverge);
@@ -36,7 +36,7 @@ LL - x.field.map(diverge);
3636LL + if let Ok(x_field) = x.field { diverge(x_field) }
3737 |
3838
39- error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
39+ error: called `map(f)` on a `Result` value where `f` is a closure that returns the unit type `()`
4040 --> tests/ui/result_map_unit_fn_fixable.rs:45:5
4141 |
4242LL | x.field.map(|value| x.do_result_nothing(value + captured));
@@ -48,7 +48,7 @@ LL - x.field.map(|value| x.do_result_nothing(value + captured));
4848LL + if let Ok(value) = x.field { x.do_result_nothing(value + captured) }
4949 |
5050
51- error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
51+ error: called `map(f)` on a `Result` value where `f` is a closure that returns the unit type `()`
5252 --> tests/ui/result_map_unit_fn_fixable.rs:48:5
5353 |
5454LL | x.field.map(|value| { x.do_result_plus_one(value + captured); });
@@ -60,7 +60,7 @@ LL - x.field.map(|value| { x.do_result_plus_one(value + captured); });
6060LL + if let Ok(value) = x.field { x.do_result_plus_one(value + captured); }
6161 |
6262
63- error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
63+ error: called `map(f)` on a `Result` value where `f` is a closure that returns the unit type `()`
6464 --> tests/ui/result_map_unit_fn_fixable.rs:52:5
6565 |
6666LL | x.field.map(|value| do_nothing(value + captured));
@@ -72,7 +72,7 @@ LL - x.field.map(|value| do_nothing(value + captured));
7272LL + if let Ok(value) = x.field { do_nothing(value + captured) }
7373 |
7474
75- error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
75+ error: called `map(f)` on a `Result` value where `f` is a closure that returns the unit type `()`
7676 --> tests/ui/result_map_unit_fn_fixable.rs:55:5
7777 |
7878LL | x.field.map(|value| { do_nothing(value + captured) });
@@ -84,7 +84,7 @@ LL - x.field.map(|value| { do_nothing(value + captured) });
8484LL + if let Ok(value) = x.field { do_nothing(value + captured) }
8585 |
8686
87- error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
87+ error: called `map(f)` on a `Result` value where `f` is a closure that returns the unit type `()`
8888 --> tests/ui/result_map_unit_fn_fixable.rs:58:5
8989 |
9090LL | x.field.map(|value| { do_nothing(value + captured); });
@@ -96,7 +96,7 @@ LL - x.field.map(|value| { do_nothing(value + captured); });
9696LL + if let Ok(value) = x.field { do_nothing(value + captured); }
9797 |
9898
99- error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
99+ error: called `map(f)` on a `Result` value where `f` is a closure that returns the unit type `()`
100100 --> tests/ui/result_map_unit_fn_fixable.rs:61:5
101101 |
102102LL | x.field.map(|value| { { do_nothing(value + captured); } });
@@ -108,7 +108,7 @@ LL - x.field.map(|value| { { do_nothing(value + captured); } });
108108LL + if let Ok(value) = x.field { do_nothing(value + captured); }
109109 |
110110
111- error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
111+ error: called `map(f)` on a `Result` value where `f` is a closure that returns the unit type `()`
112112 --> tests/ui/result_map_unit_fn_fixable.rs:65:5
113113 |
114114LL | x.field.map(|value| diverge(value + captured));
@@ -120,7 +120,7 @@ LL - x.field.map(|value| diverge(value + captured));
120120LL + if let Ok(value) = x.field { diverge(value + captured) }
121121 |
122122
123- error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
123+ error: called `map(f)` on a `Result` value where `f` is a closure that returns the unit type `()`
124124 --> tests/ui/result_map_unit_fn_fixable.rs:68:5
125125 |
126126LL | x.field.map(|value| { diverge(value + captured) });
@@ -132,7 +132,7 @@ LL - x.field.map(|value| { diverge(value + captured) });
132132LL + if let Ok(value) = x.field { diverge(value + captured) }
133133 |
134134
135- error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
135+ error: called `map(f)` on a `Result` value where `f` is a closure that returns the unit type `()`
136136 --> tests/ui/result_map_unit_fn_fixable.rs:71:5
137137 |
138138LL | x.field.map(|value| { diverge(value + captured); });
@@ -144,7 +144,7 @@ LL - x.field.map(|value| { diverge(value + captured); });
144144LL + if let Ok(value) = x.field { diverge(value + captured); }
145145 |
146146
147- error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
147+ error: called `map(f)` on a `Result` value where `f` is a closure that returns the unit type `()`
148148 --> tests/ui/result_map_unit_fn_fixable.rs:74:5
149149 |
150150LL | x.field.map(|value| { { diverge(value + captured); } });
@@ -156,7 +156,7 @@ LL - x.field.map(|value| { { diverge(value + captured); } });
156156LL + if let Ok(value) = x.field { diverge(value + captured); }
157157 |
158158
159- error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
159+ error: called `map(f)` on a `Result` value where `f` is a closure that returns the unit type `()`
160160 --> tests/ui/result_map_unit_fn_fixable.rs:80:5
161161 |
162162LL | x.field.map(|value| { let y = plus_one(value + captured); });
@@ -168,7 +168,7 @@ LL - x.field.map(|value| { let y = plus_one(value + captured); });
168168LL + if let Ok(value) = x.field { let y = plus_one(value + captured); }
169169 |
170170
171- error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
171+ error: called `map(f)` on a `Result` value where `f` is a closure that returns the unit type `()`
172172 --> tests/ui/result_map_unit_fn_fixable.rs:83:5
173173 |
174174LL | x.field.map(|value| { plus_one(value + captured); });
@@ -180,7 +180,7 @@ LL - x.field.map(|value| { plus_one(value + captured); });
180180LL + if let Ok(value) = x.field { plus_one(value + captured); }
181181 |
182182
183- error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
183+ error: called `map(f)` on a `Result` value where `f` is a closure that returns the unit type `()`
184184 --> tests/ui/result_map_unit_fn_fixable.rs:86:5
185185 |
186186LL | x.field.map(|value| { { plus_one(value + captured); } });
@@ -192,7 +192,7 @@ LL - x.field.map(|value| { { plus_one(value + captured); } });
192192LL + if let Ok(value) = x.field { plus_one(value + captured); }
193193 |
194194
195- error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
195+ error: called `map(f)` on a `Result` value where `f` is a closure that returns the unit type `()`
196196 --> tests/ui/result_map_unit_fn_fixable.rs:90:5
197197 |
198198LL | x.field.map(|ref value| { do_nothing(value + captured) });
@@ -204,7 +204,7 @@ LL - x.field.map(|ref value| { do_nothing(value + captured) });
204204LL + if let Ok(ref value) = x.field { do_nothing(value + captured) }
205205 |
206206
207- error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
207+ error: called `map(f)` on a `Result` value where `f` is a closure that returns the unit type `()`
208208 --> tests/ui/result_map_unit_fn_fixable.rs:93:5
209209 |
210210LL | x.field.map(|value| println!("{value:?}"));
0 commit comments