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