1 error: called `map(f)` on an `Result` value where `f` is a function that returns the unit type `()`
2 --> $DIR/result_map_unit_fn_fixable.rs:35:5
4 LL | x.field.map(do_nothing);
5 | ^^^^^^^^^^^^^^^^^^^^^^^-
7 | help: try this: `if let Ok(x_field) = x.field { do_nothing(x_field) }`
9 = note: `-D clippy::result-map-unit-fn` implied by `-D warnings`
11 error: called `map(f)` on an `Result` value where `f` is a function that returns the unit type `()`
12 --> $DIR/result_map_unit_fn_fixable.rs:37:5
14 LL | x.field.map(do_nothing);
15 | ^^^^^^^^^^^^^^^^^^^^^^^-
17 | help: try this: `if let Ok(x_field) = x.field { do_nothing(x_field) }`
19 error: called `map(f)` on an `Result` value where `f` is a function that returns the unit type `()`
20 --> $DIR/result_map_unit_fn_fixable.rs:39:5
22 LL | x.field.map(diverge);
23 | ^^^^^^^^^^^^^^^^^^^^-
25 | help: try this: `if let Ok(x_field) = x.field { diverge(x_field) }`
27 error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
28 --> $DIR/result_map_unit_fn_fixable.rs:45:5
30 LL | x.field.map(|value| x.do_result_nothing(value + captured));
31 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
33 | help: try this: `if let Ok(value) = x.field { x.do_result_nothing(value + captured) }`
35 error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
36 --> $DIR/result_map_unit_fn_fixable.rs:47:5
38 LL | x.field.map(|value| { x.do_result_plus_one(value + captured); });
39 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
41 | help: try this: `if let Ok(value) = x.field { x.do_result_plus_one(value + captured); }`
43 error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
44 --> $DIR/result_map_unit_fn_fixable.rs:50:5
46 LL | x.field.map(|value| do_nothing(value + captured));
47 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
49 | help: try this: `if let Ok(value) = x.field { do_nothing(value + captured) }`
51 error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
52 --> $DIR/result_map_unit_fn_fixable.rs:52:5
54 LL | x.field.map(|value| { do_nothing(value + captured) });
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
57 | help: try this: `if let Ok(value) = x.field { do_nothing(value + captured) }`
59 error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
60 --> $DIR/result_map_unit_fn_fixable.rs:54:5
62 LL | x.field.map(|value| { do_nothing(value + captured); });
63 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
65 | help: try this: `if let Ok(value) = x.field { do_nothing(value + captured); }`
67 error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
68 --> $DIR/result_map_unit_fn_fixable.rs:56:5
70 LL | x.field.map(|value| { { do_nothing(value + captured); } });
71 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
73 | help: try this: `if let Ok(value) = x.field { do_nothing(value + captured); }`
75 error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
76 --> $DIR/result_map_unit_fn_fixable.rs:59:5
78 LL | x.field.map(|value| diverge(value + captured));
79 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
81 | help: try this: `if let Ok(value) = x.field { diverge(value + captured) }`
83 error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
84 --> $DIR/result_map_unit_fn_fixable.rs:61:5
86 LL | x.field.map(|value| { diverge(value + captured) });
87 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
89 | help: try this: `if let Ok(value) = x.field { diverge(value + captured) }`
91 error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
92 --> $DIR/result_map_unit_fn_fixable.rs:63:5
94 LL | x.field.map(|value| { diverge(value + captured); });
95 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
97 | help: try this: `if let Ok(value) = x.field { diverge(value + captured); }`
99 error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
100 --> $DIR/result_map_unit_fn_fixable.rs:65:5
102 LL | x.field.map(|value| { { diverge(value + captured); } });
103 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
105 | help: try this: `if let Ok(value) = x.field { diverge(value + captured); }`
107 error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
108 --> $DIR/result_map_unit_fn_fixable.rs:70:5
110 LL | x.field.map(|value| { let y = plus_one(value + captured); });
111 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
113 | help: try this: `if let Ok(value) = x.field { let y = plus_one(value + captured); }`
115 error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
116 --> $DIR/result_map_unit_fn_fixable.rs:72:5
118 LL | x.field.map(|value| { plus_one(value + captured); });
119 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
121 | help: try this: `if let Ok(value) = x.field { plus_one(value + captured); }`
123 error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
124 --> $DIR/result_map_unit_fn_fixable.rs:74:5
126 LL | x.field.map(|value| { { plus_one(value + captured); } });
127 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
129 | help: try this: `if let Ok(value) = x.field { plus_one(value + captured); }`
131 error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
132 --> $DIR/result_map_unit_fn_fixable.rs:77:5
134 LL | x.field.map(|ref value| { do_nothing(value + captured) });
135 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
137 | help: try this: `if let Ok(ref value) = x.field { do_nothing(value + captured) }`
139 error: aborting due to 17 previous errors