]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/option_map_unit_fn_fixable.stderr
Rollup merge of #94467 - ibraheemdev:master, r=pnkfelix
[rust.git] / src / tools / clippy / tests / ui / option_map_unit_fn_fixable.stderr
1 error: called `map(f)` on an `Option` value where `f` is a function that returns the unit type `()`
2   --> $DIR/option_map_unit_fn_fixable.rs:39:5
3    |
4 LL |     x.field.map(do_nothing);
5    |     ^^^^^^^^^^^^^^^^^^^^^^^-
6    |     |
7    |     help: try this: `if let Some(x_field) = x.field { do_nothing(x_field) }`
8    |
9    = note: `-D clippy::option-map-unit-fn` implied by `-D warnings`
10
11 error: called `map(f)` on an `Option` value where `f` is a function that returns the unit type `()`
12   --> $DIR/option_map_unit_fn_fixable.rs:41:5
13    |
14 LL |     x.field.map(do_nothing);
15    |     ^^^^^^^^^^^^^^^^^^^^^^^-
16    |     |
17    |     help: try this: `if let Some(x_field) = x.field { do_nothing(x_field) }`
18
19 error: called `map(f)` on an `Option` value where `f` is a function that returns the unit type `()`
20   --> $DIR/option_map_unit_fn_fixable.rs:43:5
21    |
22 LL |     x.field.map(diverge);
23    |     ^^^^^^^^^^^^^^^^^^^^-
24    |     |
25    |     help: try this: `if let Some(x_field) = x.field { diverge(x_field) }`
26
27 error: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`
28   --> $DIR/option_map_unit_fn_fixable.rs:49:5
29    |
30 LL |     x.field.map(|value| x.do_option_nothing(value + captured));
31    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
32    |     |
33    |     help: try this: `if let Some(value) = x.field { x.do_option_nothing(value + captured) }`
34
35 error: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`
36   --> $DIR/option_map_unit_fn_fixable.rs:51:5
37    |
38 LL |     x.field.map(|value| { x.do_option_plus_one(value + captured); });
39    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
40    |     |
41    |     help: try this: `if let Some(value) = x.field { x.do_option_plus_one(value + captured); }`
42
43 error: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`
44   --> $DIR/option_map_unit_fn_fixable.rs:54:5
45    |
46 LL |     x.field.map(|value| do_nothing(value + captured));
47    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
48    |     |
49    |     help: try this: `if let Some(value) = x.field { do_nothing(value + captured) }`
50
51 error: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`
52   --> $DIR/option_map_unit_fn_fixable.rs:56:5
53    |
54 LL |     x.field.map(|value| { do_nothing(value + captured) });
55    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
56    |     |
57    |     help: try this: `if let Some(value) = x.field { do_nothing(value + captured) }`
58
59 error: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`
60   --> $DIR/option_map_unit_fn_fixable.rs:58:5
61    |
62 LL |     x.field.map(|value| { do_nothing(value + captured); });
63    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
64    |     |
65    |     help: try this: `if let Some(value) = x.field { do_nothing(value + captured); }`
66
67 error: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`
68   --> $DIR/option_map_unit_fn_fixable.rs:60:5
69    |
70 LL |     x.field.map(|value| { { do_nothing(value + captured); } });
71    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
72    |     |
73    |     help: try this: `if let Some(value) = x.field { do_nothing(value + captured); }`
74
75 error: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`
76   --> $DIR/option_map_unit_fn_fixable.rs:63:5
77    |
78 LL |     x.field.map(|value| diverge(value + captured));
79    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
80    |     |
81    |     help: try this: `if let Some(value) = x.field { diverge(value + captured) }`
82
83 error: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`
84   --> $DIR/option_map_unit_fn_fixable.rs:65:5
85    |
86 LL |     x.field.map(|value| { diverge(value + captured) });
87    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
88    |     |
89    |     help: try this: `if let Some(value) = x.field { diverge(value + captured) }`
90
91 error: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`
92   --> $DIR/option_map_unit_fn_fixable.rs:67:5
93    |
94 LL |     x.field.map(|value| { diverge(value + captured); });
95    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
96    |     |
97    |     help: try this: `if let Some(value) = x.field { diverge(value + captured); }`
98
99 error: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`
100   --> $DIR/option_map_unit_fn_fixable.rs:69:5
101    |
102 LL |     x.field.map(|value| { { diverge(value + captured); } });
103    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
104    |     |
105    |     help: try this: `if let Some(value) = x.field { diverge(value + captured); }`
106
107 error: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`
108   --> $DIR/option_map_unit_fn_fixable.rs:74:5
109    |
110 LL |     x.field.map(|value| { let y = plus_one(value + captured); });
111    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
112    |     |
113    |     help: try this: `if let Some(value) = x.field { let y = plus_one(value + captured); }`
114
115 error: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`
116   --> $DIR/option_map_unit_fn_fixable.rs:76:5
117    |
118 LL |     x.field.map(|value| { plus_one(value + captured); });
119    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
120    |     |
121    |     help: try this: `if let Some(value) = x.field { plus_one(value + captured); }`
122
123 error: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`
124   --> $DIR/option_map_unit_fn_fixable.rs:78:5
125    |
126 LL |     x.field.map(|value| { { plus_one(value + captured); } });
127    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
128    |     |
129    |     help: try this: `if let Some(value) = x.field { plus_one(value + captured); }`
130
131 error: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`
132   --> $DIR/option_map_unit_fn_fixable.rs:81:5
133    |
134 LL |     x.field.map(|ref value| { do_nothing(value + captured) });
135    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
136    |     |
137    |     help: try this: `if let Some(ref value) = x.field { do_nothing(value + captured) }`
138
139 error: called `map(f)` on an `Option` value where `f` is a function that returns the unit type `()`
140   --> $DIR/option_map_unit_fn_fixable.rs:83:5
141    |
142 LL |     option().map(do_nothing);
143    |     ^^^^^^^^^^^^^^^^^^^^^^^^-
144    |     |
145    |     help: try this: `if let Some(a) = option() { do_nothing(a) }`
146
147 error: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`
148   --> $DIR/option_map_unit_fn_fixable.rs:85:5
149    |
150 LL |     option().map(|value| println!("{:?}", value));
151    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
152    |     |
153    |     help: try this: `if let Some(value) = option() { println!("{:?}", value) }`
154
155 error: aborting due to 19 previous errors
156