2020-09-10 10:47:07 -05:00
|
|
|
error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
|
2020-04-13 08:26:53 -05:00
|
|
|
--> $DIR/result_map_unit_fn_unfixable.rs:23:5
|
2019-09-25 10:48:09 -05:00
|
|
|
|
|
|
|
|
LL | x.field.map(|value| { do_nothing(value); do_nothing(value) });
|
2020-04-13 08:26:53 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
|
|
|
| |
|
2023-07-17 03:19:29 -05:00
|
|
|
| help: try: `if let Ok(value) = x.field { ... }`
|
2020-04-13 08:26:53 -05:00
|
|
|
|
|
|
|
|
= note: `-D clippy::result-map-unit-fn` implied by `-D warnings`
|
2019-09-25 10:48:09 -05:00
|
|
|
|
2020-09-10 10:47:07 -05:00
|
|
|
error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
|
2020-04-13 08:26:53 -05:00
|
|
|
--> $DIR/result_map_unit_fn_unfixable.rs:25:5
|
2019-09-25 10:48:09 -05:00
|
|
|
|
|
|
|
|
LL | x.field.map(|value| if value > 0 { do_nothing(value); do_nothing(value) });
|
2020-04-13 08:26:53 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
|
|
|
| |
|
2023-07-17 03:19:29 -05:00
|
|
|
| help: try: `if let Ok(value) = x.field { ... }`
|
2019-09-25 10:48:09 -05:00
|
|
|
|
2020-09-10 10:47:07 -05:00
|
|
|
error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
|
2020-04-13 08:26:53 -05:00
|
|
|
--> $DIR/result_map_unit_fn_unfixable.rs:29:5
|
2019-09-25 10:48:09 -05:00
|
|
|
|
|
2022-12-27 13:03:59 -06:00
|
|
|
LL | // x.field.map(|value| {
|
2020-04-13 08:26:53 -05:00
|
|
|
LL | || do_nothing(value);
|
|
|
|
LL | || do_nothing(value)
|
|
|
|
LL | || });
|
2023-07-17 03:19:29 -05:00
|
|
|
| ||______^- help: try: `if let Ok(value) = x.field { ... }`
|
2022-11-28 02:41:31 -06:00
|
|
|
| |______|
|
2020-04-13 08:26:53 -05:00
|
|
|
|
|
2019-09-25 10:48:09 -05:00
|
|
|
|
2020-09-10 10:47:07 -05:00
|
|
|
error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
|
2020-04-13 08:26:53 -05:00
|
|
|
--> $DIR/result_map_unit_fn_unfixable.rs:33:5
|
2019-09-25 10:48:09 -05:00
|
|
|
|
|
|
|
|
LL | x.field.map(|value| { do_nothing(value); do_nothing(value); });
|
2020-04-13 08:26:53 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
|
|
|
| |
|
2023-07-17 03:19:29 -05:00
|
|
|
| help: try: `if let Ok(value) = x.field { ... }`
|
2020-04-13 08:26:53 -05:00
|
|
|
|
2020-09-10 10:47:07 -05:00
|
|
|
error: called `map(f)` on an `Result` value where `f` is a function that returns the unit type `()`
|
2020-04-13 08:26:53 -05:00
|
|
|
--> $DIR/result_map_unit_fn_unfixable.rs:37:5
|
|
|
|
|
|
|
|
|
LL | "12".parse::<i32>().map(diverge);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
|
|
|
| |
|
2023-07-17 03:19:29 -05:00
|
|
|
| help: try: `if let Ok(a) = "12".parse::<i32>() { diverge(a) }`
|
2020-04-13 08:26:53 -05:00
|
|
|
|
2020-09-10 10:47:07 -05:00
|
|
|
error: called `map(f)` on an `Result` value where `f` is a function that returns the unit type `()`
|
2020-04-13 08:26:53 -05:00
|
|
|
--> $DIR/result_map_unit_fn_unfixable.rs:43:5
|
|
|
|
|
|
|
|
|
LL | y.map(do_nothing);
|
|
|
|
| ^^^^^^^^^^^^^^^^^-
|
|
|
|
| |
|
2023-07-17 03:19:29 -05:00
|
|
|
| help: try: `if let Ok(_y) = y { do_nothing(_y) }`
|
2019-09-25 10:48:09 -05:00
|
|
|
|
2020-04-13 08:26:53 -05:00
|
|
|
error: aborting due to 6 previous errors
|
2019-09-25 10:48:09 -05:00
|
|
|
|