1- error: called `map(f)` on an `Option` value where `f` is a unit function
1+ error: called `map(f)` on an `Option` value where `f` is a function that returns the unit type
22 --> $DIR/option_map_unit_fn_fixable.rs:34:5
33 |
44LL | x.field.map(do_nothing);
@@ -8,127 +8,127 @@ LL | x.field.map(do_nothing);
88 |
99 = note: `-D clippy::option-map-unit-fn` implied by `-D warnings`
1010
11- error: called `map(f)` on an `Option` value where `f` is a unit function
11+ error: called `map(f)` on an `Option` value where `f` is a function that returns the unit type
1212 --> $DIR/option_map_unit_fn_fixable.rs:36:5
1313 |
1414LL | x.field.map(do_nothing);
1515 | ^^^^^^^^^^^^^^^^^^^^^^^-
1616 | |
1717 | help: try this: `if let Some(x_field) = x.field { do_nothing(x_field) }`
1818
19- error: called `map(f)` on an `Option` value where `f` is a unit function
19+ error: called `map(f)` on an `Option` value where `f` is a function that returns the unit type
2020 --> $DIR/option_map_unit_fn_fixable.rs:38:5
2121 |
2222LL | x.field.map(diverge);
2323 | ^^^^^^^^^^^^^^^^^^^^-
2424 | |
2525 | help: try this: `if let Some(x_field) = x.field { diverge(x_field) }`
2626
27- error: called `map(f)` on an `Option` value where `f` is a unit closure
27+ error: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type
2828 --> $DIR/option_map_unit_fn_fixable.rs:44:5
2929 |
3030LL | x.field.map(|value| x.do_option_nothing(value + captured));
3131 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
3232 | |
3333 | help: try this: `if let Some(value) = x.field { x.do_option_nothing(value + captured) }`
3434
35- error: called `map(f)` on an `Option` value where `f` is a unit closure
35+ error: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type
3636 --> $DIR/option_map_unit_fn_fixable.rs:46:5
3737 |
3838LL | x.field.map(|value| { x.do_option_plus_one(value + captured); });
3939 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
4040 | |
4141 | help: try this: `if let Some(value) = x.field { x.do_option_plus_one(value + captured); }`
4242
43- error: called `map(f)` on an `Option` value where `f` is a unit closure
43+ error: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type
4444 --> $DIR/option_map_unit_fn_fixable.rs:49:5
4545 |
4646LL | x.field.map(|value| do_nothing(value + captured));
4747 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
4848 | |
4949 | help: try this: `if let Some(value) = x.field { do_nothing(value + captured) }`
5050
51- error: called `map(f)` on an `Option` value where `f` is a unit closure
51+ error: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type
5252 --> $DIR/option_map_unit_fn_fixable.rs:51:5
5353 |
5454LL | x.field.map(|value| { do_nothing(value + captured) });
5555 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
5656 | |
5757 | help: try this: `if let Some(value) = x.field { do_nothing(value + captured) }`
5858
59- error: called `map(f)` on an `Option` value where `f` is a unit closure
59+ error: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type
6060 --> $DIR/option_map_unit_fn_fixable.rs:53:5
6161 |
6262LL | x.field.map(|value| { do_nothing(value + captured); });
6363 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
6464 | |
6565 | help: try this: `if let Some(value) = x.field { do_nothing(value + captured); }`
6666
67- error: called `map(f)` on an `Option` value where `f` is a unit closure
67+ error: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type
6868 --> $DIR/option_map_unit_fn_fixable.rs:55:5
6969 |
7070LL | x.field.map(|value| { { do_nothing(value + captured); } });
7171 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
7272 | |
7373 | help: try this: `if let Some(value) = x.field { do_nothing(value + captured); }`
7474
75- error: called `map(f)` on an `Option` value where `f` is a unit closure
75+ error: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type
7676 --> $DIR/option_map_unit_fn_fixable.rs:58:5
7777 |
7878LL | x.field.map(|value| diverge(value + captured));
7979 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
8080 | |
8181 | help: try this: `if let Some(value) = x.field { diverge(value + captured) }`
8282
83- error: called `map(f)` on an `Option` value where `f` is a unit closure
83+ error: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type
8484 --> $DIR/option_map_unit_fn_fixable.rs:60:5
8585 |
8686LL | x.field.map(|value| { diverge(value + captured) });
8787 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
8888 | |
8989 | help: try this: `if let Some(value) = x.field { diverge(value + captured) }`
9090
91- error: called `map(f)` on an `Option` value where `f` is a unit closure
91+ error: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type
9292 --> $DIR/option_map_unit_fn_fixable.rs:62:5
9393 |
9494LL | x.field.map(|value| { diverge(value + captured); });
9595 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
9696 | |
9797 | help: try this: `if let Some(value) = x.field { diverge(value + captured); }`
9898
99- error: called `map(f)` on an `Option` value where `f` is a unit closure
99+ error: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type
100100 --> $DIR/option_map_unit_fn_fixable.rs:64:5
101101 |
102102LL | x.field.map(|value| { { diverge(value + captured); } });
103103 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
104104 | |
105105 | help: try this: `if let Some(value) = x.field { diverge(value + captured); }`
106106
107- error: called `map(f)` on an `Option` value where `f` is a unit closure
107+ error: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type
108108 --> $DIR/option_map_unit_fn_fixable.rs:69:5
109109 |
110110LL | x.field.map(|value| { let y = plus_one(value + captured); });
111111 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
112112 | |
113113 | help: try this: `if let Some(value) = x.field { let y = plus_one(value + captured); }`
114114
115- error: called `map(f)` on an `Option` value where `f` is a unit closure
115+ error: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type
116116 --> $DIR/option_map_unit_fn_fixable.rs:71:5
117117 |
118118LL | x.field.map(|value| { plus_one(value + captured); });
119119 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
120120 | |
121121 | help: try this: `if let Some(value) = x.field { plus_one(value + captured); }`
122122
123- error: called `map(f)` on an `Option` value where `f` is a unit closure
123+ error: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type
124124 --> $DIR/option_map_unit_fn_fixable.rs:73:5
125125 |
126126LL | x.field.map(|value| { { plus_one(value + captured); } });
127127 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
128128 | |
129129 | help: try this: `if let Some(value) = x.field { plus_one(value + captured); }`
130130
131- error: called `map(f)` on an `Option` value where `f` is a unit closure
131+ error: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type
132132 --> $DIR/option_map_unit_fn_fixable.rs:76:5
133133 |
134134LL | x.field.map(|ref value| { do_nothing(value + captured) });}
0 commit comments