]> git.lizzy.rs Git - rust.git/blob - tests/ui/result_map_unit_fn.stderr
update test stderr
[rust.git] / tests / ui / result_map_unit_fn.stderr
1 error: called `map(f)` on an Result value where `f` is a unit function
2   --> $DIR/result_map_unit_fn.rs:42:5
3    |
4 42 |     x.field.map(do_nothing);
5    |     ^^^^^^^^^^^^^^^^^^^^^^^-
6    |     |
7    |     help: try this: `if let Ok(x_field) = x.field { do_nothing(...) }`
8    |
9    = note: `-D clippy::result-map-unit-fn` implied by `-D warnings`
10
11 error: called `map(f)` on an Result value where `f` is a unit function
12   --> $DIR/result_map_unit_fn.rs:44:5
13    |
14 44 |     x.field.map(do_nothing);
15    |     ^^^^^^^^^^^^^^^^^^^^^^^-
16    |     |
17    |     help: try this: `if let Ok(x_field) = x.field { do_nothing(...) }`
18
19 error: called `map(f)` on an Result value where `f` is a unit function
20   --> $DIR/result_map_unit_fn.rs:46:5
21    |
22 46 |     x.field.map(diverge);
23    |     ^^^^^^^^^^^^^^^^^^^^-
24    |     |
25    |     help: try this: `if let Ok(x_field) = x.field { diverge(...) }`
26
27 error: called `map(f)` on an Result value where `f` is a unit closure
28   --> $DIR/result_map_unit_fn.rs:54:5
29    |
30 54 |     x.field.map(|value| x.do_result_nothing(value + captured));
31    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
32    |     |
33    |     help: try this: `if let Ok(value) = x.field { x.do_result_nothing(value + captured) }`
34
35 error: called `map(f)` on an Result value where `f` is a unit closure
36   --> $DIR/result_map_unit_fn.rs:56:5
37    |
38 56 |        x.field.map(|value| {
39    |   _____^
40    |  |_____|
41    | ||
42 57 | ||         x.do_result_plus_one(value + captured);
43 58 | ||     });
44    | ||______^- help: try this: `if let Ok(value) = x.field { x.do_result_plus_one(value + captured); }`
45    | |_______|
46    | 
47
48 error: called `map(f)` on an Result value where `f` is a unit closure
49   --> $DIR/result_map_unit_fn.rs:60:5
50    |
51 60 |     x.field.map(|value| do_nothing(value + captured));
52    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
53    |     |
54    |     help: try this: `if let Ok(value) = x.field { do_nothing(value + captured) }`
55
56 error: called `map(f)` on an Result value where `f` is a unit closure
57   --> $DIR/result_map_unit_fn.rs:62:5
58    |
59 62 |     x.field.map(|value| do_nothing(value + captured));
60    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
61    |     |
62    |     help: try this: `if let Ok(value) = x.field { do_nothing(value + captured) }`
63
64 error: called `map(f)` on an Result value where `f` is a unit closure
65   --> $DIR/result_map_unit_fn.rs:64:5
66    |
67 64 |        x.field.map(|value| {
68    |   _____^
69    |  |_____|
70    | ||
71 65 | ||         do_nothing(value + captured);
72 66 | ||     });
73    | ||______^- help: try this: `if let Ok(value) = x.field { do_nothing(value + captured); }`
74    | |_______|
75    | 
76
77 error: called `map(f)` on an Result value where `f` is a unit closure
78   --> $DIR/result_map_unit_fn.rs:68:5
79    |
80 68 |        x.field.map(|value| {
81    |   _____^
82    |  |_____|
83    | ||
84 69 | ||         do_nothing(value + captured);
85 70 | ||     });
86    | ||______^- help: try this: `if let Ok(value) = x.field { do_nothing(value + captured); }`
87    | |_______|
88    | 
89
90 error: called `map(f)` on an Result value where `f` is a unit closure
91   --> $DIR/result_map_unit_fn.rs:72:5
92    |
93 72 |     x.field.map(|value| diverge(value + captured));
94    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
95    |     |
96    |     help: try this: `if let Ok(value) = x.field { diverge(value + captured) }`
97
98 error: called `map(f)` on an Result value where `f` is a unit closure
99   --> $DIR/result_map_unit_fn.rs:74:5
100    |
101 74 |     x.field.map(|value| diverge(value + captured));
102    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
103    |     |
104    |     help: try this: `if let Ok(value) = x.field { diverge(value + captured) }`
105
106 error: called `map(f)` on an Result value where `f` is a unit closure
107   --> $DIR/result_map_unit_fn.rs:76:5
108    |
109 76 |        x.field.map(|value| {
110    |   _____^
111    |  |_____|
112    | ||
113 77 | ||         diverge(value + captured);
114 78 | ||     });
115    | ||______^- help: try this: `if let Ok(value) = x.field { diverge(value + captured); }`
116    | |_______|
117    | 
118
119 error: called `map(f)` on an Result value where `f` is a unit closure
120   --> $DIR/result_map_unit_fn.rs:80:5
121    |
122 80 |        x.field.map(|value| {
123    |   _____^
124    |  |_____|
125    | ||
126 81 | ||         diverge(value + captured);
127 82 | ||     });
128    | ||______^- help: try this: `if let Ok(value) = x.field { diverge(value + captured); }`
129    | |_______|
130    | 
131
132 error: called `map(f)` on an Result value where `f` is a unit closure
133   --> $DIR/result_map_unit_fn.rs:86:5
134    |
135 86 |        x.field.map(|value| {
136    |   _____^
137    |  |_____|
138    | ||
139 87 | ||         let y = plus_one(value + captured);
140 88 | ||     });
141    | ||______^- help: try this: `if let Ok(value) = x.field { let y = plus_one(value + captured); }`
142    | |_______|
143    | 
144
145 error: called `map(f)` on an Result value where `f` is a unit closure
146   --> $DIR/result_map_unit_fn.rs:90:5
147    |
148 90 |        x.field.map(|value| {
149    |   _____^
150    |  |_____|
151    | ||
152 91 | ||         plus_one(value + captured);
153 92 | ||     });
154    | ||______^- help: try this: `if let Ok(value) = x.field { plus_one(value + captured); }`
155    | |_______|
156    | 
157
158 error: called `map(f)` on an Result value where `f` is a unit closure
159   --> $DIR/result_map_unit_fn.rs:94:5
160    |
161 94 |        x.field.map(|value| {
162    |   _____^
163    |  |_____|
164    | ||
165 95 | ||         plus_one(value + captured);
166 96 | ||     });
167    | ||______^- help: try this: `if let Ok(value) = x.field { plus_one(value + captured); }`
168    | |_______|
169    | 
170
171 error: called `map(f)` on an Result value where `f` is a unit closure
172   --> $DIR/result_map_unit_fn.rs:98:5
173    |
174 98 |     x.field.map(|ref value| do_nothing(value + captured));
175    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
176    |     |
177    |     help: try this: `if let Ok(ref value) = x.field { do_nothing(value + captured) }`
178
179 error: called `map(f)` on an Result value where `f` is a unit closure
180    --> $DIR/result_map_unit_fn.rs:100:5
181     |
182 100 |        x.field.map(|value| {
183     |   _____^
184     |  |_____|
185     | ||
186 101 | ||         do_nothing(value);
187 102 | ||         do_nothing(value)
188 103 | ||     });
189     | ||______^- help: try this: `if let Ok(value) = x.field { ... }`
190     | |_______|
191     | 
192
193 error: called `map(f)` on an Result value where `f` is a unit closure
194    --> $DIR/result_map_unit_fn.rs:105:5
195     |
196 105 |        x.field.map(|value| {
197     |   _____^
198     |  |_____|
199     | ||
200 106 | ||         if value > 0 {
201 107 | ||             do_nothing(value);
202 108 | ||             do_nothing(value)
203 109 | ||         }
204 110 | ||     });
205     | ||______^- help: try this: `if let Ok(value) = x.field { ... }`
206     | |_______|
207     | 
208
209 error: called `map(f)` on an Result value where `f` is a unit closure
210    --> $DIR/result_map_unit_fn.rs:114:5
211     |
212 114 |        x.field.map(|value| {
213     |   _____^
214     |  |_____|
215     | ||
216 115 | ||         do_nothing(value);
217 116 | ||         do_nothing(value)
218 117 | ||     });
219     | ||______^- help: try this: `if let Ok(value) = x.field { ... }`
220     | |_______|
221     | 
222
223 error: called `map(f)` on an Result value where `f` is a unit closure
224    --> $DIR/result_map_unit_fn.rs:118:5
225     |
226 118 |        x.field.map(|value| {
227     |   _____^
228     |  |_____|
229     | ||
230 119 | ||         do_nothing(value);
231 120 | ||         do_nothing(value);
232 121 | ||     });
233     | ||______^- help: try this: `if let Ok(value) = x.field { ... }`
234     | |_______|
235     | 
236
237 error: called `map(f)` on an Result value where `f` is a unit function
238    --> $DIR/result_map_unit_fn.rs:126:5
239     |
240 126 |     "12".parse::<i32>().map(diverge);
241     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
242     |     |
243     |     help: try this: `if let Ok(_) = "12".parse::<i32>() { diverge(...) }`
244
245 error: called `map(f)` on an Result value where `f` is a unit function
246    --> $DIR/result_map_unit_fn.rs:132:5
247     |
248 132 |     y.map(do_nothing);
249     |     ^^^^^^^^^^^^^^^^^-
250     |     |
251     |     help: try this: `if let Ok(_y) = y { do_nothing(...) }`
252
253 error: aborting due to 23 previous errors
254