@@ -236,36 +236,33 @@ impl<'a, 'b, 'tcx> DropElaborator<'a, 'tcx> for Elaborator<'a, 'b, 'tcx> {
236
236
}
237
237
238
238
fn field_subpath ( & self , path : Self :: Path , field : Field ) -> Option < Self :: Path > {
239
- dataflow:: move_path_children_matching ( self . ctxt . move_data ( ) , path, |p | match p {
240
- [ .. , ProjectionElem :: Field ( idx, _) ] => * idx == field,
239
+ dataflow:: move_path_children_matching ( self . ctxt . move_data ( ) , path, |e | match e {
240
+ ProjectionElem :: Field ( idx, _) => * idx == field,
241
241
_ => false ,
242
242
} )
243
243
}
244
244
245
245
fn array_subpath ( & self , path : Self :: Path , index : u32 , size : u32 ) -> Option < Self :: Path > {
246
- dataflow:: move_path_children_matching ( self . ctxt . move_data ( ) , path, |p | match p {
247
- [ .. , ProjectionElem :: ConstantIndex { offset, min_length : _, from_end : false } ] => {
246
+ dataflow:: move_path_children_matching ( self . ctxt . move_data ( ) , path, |e | match e {
247
+ ProjectionElem :: ConstantIndex { offset, min_length : _, from_end : false } => {
248
248
* offset == index
249
249
}
250
- [ .. , ProjectionElem :: ConstantIndex { offset, min_length : _, from_end : true } ] => {
250
+ ProjectionElem :: ConstantIndex { offset, min_length : _, from_end : true } => {
251
251
size - offset == index
252
252
}
253
253
_ => false ,
254
254
} )
255
255
}
256
256
257
257
fn deref_subpath ( & self , path : Self :: Path ) -> Option < Self :: Path > {
258
- dataflow:: move_path_children_matching ( self . ctxt . move_data ( ) , path, |p| {
259
- match p {
260
- [ .., ProjectionElem :: Deref ] => true ,
261
- _ => false
262
- }
258
+ dataflow:: move_path_children_matching ( self . ctxt . move_data ( ) , path, |e| {
259
+ * e == ProjectionElem :: Deref
263
260
} )
264
261
}
265
262
266
263
fn downcast_subpath ( & self , path : Self :: Path , variant : VariantIdx ) -> Option < Self :: Path > {
267
- dataflow:: move_path_children_matching ( self . ctxt . move_data ( ) , path, |p | match p {
268
- [ .. , ProjectionElem :: Downcast ( _, idx) ] => * idx == variant,
264
+ dataflow:: move_path_children_matching ( self . ctxt . move_data ( ) , path, |e | match e {
265
+ ProjectionElem :: Downcast ( _, idx) => * idx == variant,
269
266
_ => false
270
267
} )
271
268
}
0 commit comments