@@ -236,36 +236,33 @@ impl<'a, 'b, 'tcx> DropElaborator<'a, 'tcx> for Elaborator<'a, 'b, 'tcx> {
236236 }
237237
238238 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,
241241 _ => false ,
242242 } )
243243 }
244244
245245 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 } => {
248248 * offset == index
249249 }
250- [ .. , ProjectionElem :: ConstantIndex { offset, min_length : _, from_end : true } ] => {
250+ ProjectionElem :: ConstantIndex { offset, min_length : _, from_end : true } => {
251251 size - offset == index
252252 }
253253 _ => false ,
254254 } )
255255 }
256256
257257 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
263260 } )
264261 }
265262
266263 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,
269266 _ => false
270267 } )
271268 }
0 commit comments