11error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
2- --> $DIR/result_map_unit_fn_unfixable.rs:23 :5
2+ --> $DIR/result_map_unit_fn_unfixable.rs:22 :5
33 |
44LL | x.field.map(|value| { do_nothing(value); do_nothing(value) });
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
@@ -9,15 +9,15 @@ LL | x.field.map(|value| { do_nothing(value); do_nothing(value) });
99 = note: `-D clippy::result-map-unit-fn` implied by `-D warnings`
1010
1111error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
12- --> $DIR/result_map_unit_fn_unfixable.rs:25 :5
12+ --> $DIR/result_map_unit_fn_unfixable.rs:24 :5
1313 |
1414LL | x.field.map(|value| if value > 0 { do_nothing(value); do_nothing(value) });
1515 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
1616 | |
1717 | help: try this: `if let Ok(value) = x.field { ... }`
1818
1919error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
20- --> $DIR/result_map_unit_fn_unfixable.rs:29 :5
20+ --> $DIR/result_map_unit_fn_unfixable.rs:28 :5
2121 |
2222LL | x.field.map(|value| {
2323 | _____^
@@ -31,23 +31,23 @@ LL | || });
3131 |
3232
3333error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
34- --> $DIR/result_map_unit_fn_unfixable.rs:33 :5
34+ --> $DIR/result_map_unit_fn_unfixable.rs:32 :5
3535 |
3636LL | x.field.map(|value| { do_nothing(value); do_nothing(value); });
3737 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
3838 | |
3939 | help: try this: `if let Ok(value) = x.field { ... }`
4040
4141error: called `map(f)` on an `Result` value where `f` is a function that returns the unit type `()`
42- --> $DIR/result_map_unit_fn_unfixable.rs:37 :5
42+ --> $DIR/result_map_unit_fn_unfixable.rs:36 :5
4343 |
4444LL | "12".parse::<i32>().map(diverge);
4545 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
4646 | |
4747 | help: try this: `if let Ok(a) = "12".parse::<i32>() { diverge(a) }`
4848
4949error: called `map(f)` on an `Result` value where `f` is a function that returns the unit type `()`
50- --> $DIR/result_map_unit_fn_unfixable.rs:43 :5
50+ --> $DIR/result_map_unit_fn_unfixable.rs:42 :5
5151 |
5252LL | y.map(do_nothing);
5353 | ^^^^^^^^^^^^^^^^^-
0 commit comments