1
1
error: 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
3
3
|
4
4
LL | x.field.map(|value| { do_nothing(value); do_nothing(value) });
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
@@ -9,15 +9,15 @@ LL | x.field.map(|value| { do_nothing(value); do_nothing(value) });
9
9
= note: `-D clippy::result-map-unit-fn` implied by `-D warnings`
10
10
11
11
error: 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
13
13
|
14
14
LL | x.field.map(|value| if value > 0 { do_nothing(value); do_nothing(value) });
15
15
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
16
16
| |
17
17
| help: try this: `if let Ok(value) = x.field { ... }`
18
18
19
19
error: 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
21
21
|
22
22
LL | x.field.map(|value| {
23
23
| _____^
@@ -31,23 +31,23 @@ LL | || });
31
31
|
32
32
33
33
error: 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
35
35
|
36
36
LL | x.field.map(|value| { do_nothing(value); do_nothing(value); });
37
37
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
38
38
| |
39
39
| help: try this: `if let Ok(value) = x.field { ... }`
40
40
41
41
error: 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
43
43
|
44
44
LL | "12".parse::<i32>().map(diverge);
45
45
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
46
46
| |
47
47
| help: try this: `if let Ok(a) = "12".parse::<i32>() { diverge(a) }`
48
48
49
49
error: 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
51
51
|
52
52
LL | y.map(do_nothing);
53
53
| ^^^^^^^^^^^^^^^^^-
0 commit comments