@@ -71,142 +71,148 @@ LL | let e: std::vec::Vec<char> = vec!['a', 'b', 'c'].iter().map(|c| c.to_as
71
71
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `char::to_ascii_uppercase`
72
72
73
73
error: redundant closure
74
- --> tests/ui/eta.rs:169:22
74
+ --> tests/ui/eta.rs:122:23
75
+ |
76
+ LL | let _ = x.map(|x| x.parse::<i16>());
77
+ | ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `str::parse::<i16>`
78
+
79
+ error: redundant closure
80
+ --> tests/ui/eta.rs:174:22
75
81
|
76
82
LL | requires_fn_once(|| x());
77
83
| ^^^^^^ help: replace the closure with the function itself: `x`
78
84
79
85
error: redundant closure
80
- --> tests/ui/eta.rs:176 :27
86
+ --> tests/ui/eta.rs:181 :27
81
87
|
82
88
LL | let a = Some(1u8).map(|a| foo_ptr(a));
83
89
| ^^^^^^^^^^^^^^ help: replace the closure with the function itself: `foo_ptr`
84
90
85
91
error: redundant closure
86
- --> tests/ui/eta.rs:181 :27
92
+ --> tests/ui/eta.rs:186 :27
87
93
|
88
94
LL | let a = Some(1u8).map(|a| closure(a));
89
95
| ^^^^^^^^^^^^^^ help: replace the closure with the function itself: `closure`
90
96
91
97
error: redundant closure
92
- --> tests/ui/eta.rs:213 :28
98
+ --> tests/ui/eta.rs:218 :28
93
99
|
94
100
LL | x.into_iter().for_each(|x| add_to_res(x));
95
101
| ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `&mut add_to_res`
96
102
97
103
error: redundant closure
98
- --> tests/ui/eta.rs:214 :28
104
+ --> tests/ui/eta.rs:219 :28
99
105
|
100
106
LL | y.into_iter().for_each(|x| add_to_res(x));
101
107
| ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `&mut add_to_res`
102
108
103
109
error: redundant closure
104
- --> tests/ui/eta.rs:215 :28
110
+ --> tests/ui/eta.rs:220 :28
105
111
|
106
112
LL | z.into_iter().for_each(|x| add_to_res(x));
107
113
| ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `add_to_res`
108
114
109
115
error: redundant closure
110
- --> tests/ui/eta.rs:222 :21
116
+ --> tests/ui/eta.rs:227 :21
111
117
|
112
118
LL | Some(1).map(|n| closure(n));
113
119
| ^^^^^^^^^^^^^^ help: replace the closure with the function itself: `&mut closure`
114
120
115
121
error: redundant closure
116
- --> tests/ui/eta.rs:226 :21
122
+ --> tests/ui/eta.rs:231 :21
117
123
|
118
124
LL | Some(1).map(|n| in_loop(n));
119
125
| ^^^^^^^^^^^^^^ help: replace the closure with the function itself: `in_loop`
120
126
121
127
error: redundant closure
122
- --> tests/ui/eta.rs:319 :18
128
+ --> tests/ui/eta.rs:324 :18
123
129
|
124
130
LL | takes_fn_mut(|| f());
125
131
| ^^^^^^ help: replace the closure with the function itself: `&mut f`
126
132
127
133
error: redundant closure
128
- --> tests/ui/eta.rs:322 :19
134
+ --> tests/ui/eta.rs:327 :19
129
135
|
130
136
LL | takes_fn_once(|| f());
131
137
| ^^^^^^ help: replace the closure with the function itself: `&mut f`
132
138
133
139
error: redundant closure
134
- --> tests/ui/eta.rs:326 :26
140
+ --> tests/ui/eta.rs:331 :26
135
141
|
136
142
LL | move || takes_fn_mut(|| f_used_once())
137
143
| ^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `&mut f_used_once`
138
144
139
145
error: redundant closure
140
- --> tests/ui/eta.rs:338 :19
146
+ --> tests/ui/eta.rs:343 :19
141
147
|
142
148
LL | array_opt.map(|a| a.as_slice());
143
149
| ^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `<[u8; 3]>::as_slice`
144
150
145
151
error: redundant closure
146
- --> tests/ui/eta.rs:341 :19
152
+ --> tests/ui/eta.rs:346 :19
147
153
|
148
154
LL | slice_opt.map(|s| s.len());
149
155
| ^^^^^^^^^^^ help: replace the closure with the method itself: `<[u8]>::len`
150
156
151
157
error: redundant closure
152
- --> tests/ui/eta.rs:344 :17
158
+ --> tests/ui/eta.rs:349 :17
153
159
|
154
160
LL | ptr_opt.map(|p| p.is_null());
155
161
| ^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `<*const usize>::is_null`
156
162
157
163
error: redundant closure
158
- --> tests/ui/eta.rs:348 :17
164
+ --> tests/ui/eta.rs:353 :17
159
165
|
160
166
LL | dyn_opt.map(|d| d.method_on_dyn());
161
167
| ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `<dyn TestTrait>::method_on_dyn`
162
168
163
169
error: redundant closure
164
- --> tests/ui/eta.rs:408 :19
170
+ --> tests/ui/eta.rs:413 :19
165
171
|
166
172
LL | let _ = f(&0, |x, y| f2(x, y));
167
173
| ^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `f2`
168
174
169
175
error: redundant closure
170
- --> tests/ui/eta.rs:436 :22
176
+ --> tests/ui/eta.rs:441 :22
171
177
|
172
178
LL | test.map(|t| t.method())
173
179
| ^^^^^^^^^^^^^^ help: replace the closure with the method itself: `Test::method`
174
180
175
181
error: redundant closure
176
- --> tests/ui/eta.rs:440 :22
182
+ --> tests/ui/eta.rs:445 :22
177
183
|
178
184
LL | test.map(|t| t.method())
179
185
| ^^^^^^^^^^^^^^ help: replace the closure with the method itself: `super::Outer::method`
180
186
181
187
error: redundant closure
182
- --> tests/ui/eta.rs:453 :18
188
+ --> tests/ui/eta.rs:458 :18
183
189
|
184
190
LL | test.map(|t| t.method())
185
191
| ^^^^^^^^^^^^^^ help: replace the closure with the method itself: `test_mod::Test::method`
186
192
187
193
error: redundant closure
188
- --> tests/ui/eta.rs:460 :30
194
+ --> tests/ui/eta.rs:465 :30
189
195
|
190
196
LL | test.map(|t| t.method())
191
197
| ^^^^^^^^^^^^^^ help: replace the closure with the method itself: `crate::issue_10854::d::Test::method`
192
198
193
199
error: redundant closure
194
- --> tests/ui/eta.rs:479 :38
200
+ --> tests/ui/eta.rs:484 :38
195
201
|
196
202
LL | let x = Box::new(|| None.map(|x| f(x)));
197
203
| ^^^^^^^^ help: replace the closure with the function itself: `&f`
198
204
199
205
error: redundant closure
200
- --> tests/ui/eta.rs:483 :38
206
+ --> tests/ui/eta.rs:488 :38
201
207
|
202
208
LL | let x = Box::new(|| None.map(|x| f(x)));
203
209
| ^^^^^^^^ help: replace the closure with the function itself: `f`
204
210
205
211
error: redundant closure
206
- --> tests/ui/eta.rs:500 :35
212
+ --> tests/ui/eta.rs:505 :35
207
213
|
208
214
LL | let _field = bind.or_else(|| get_default()).unwrap();
209
215
| ^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `get_default`
210
216
211
- error: aborting due to 34 previous errors
217
+ error: aborting due to 35 previous errors
212
218
0 commit comments