Optimize some alloc_from_iter call sites.
There's no need to collect an iterator into a `Vec`, or to call `into_iter` at the call sites.
This commit is contained in:
@@ -71,7 +71,7 @@ pub(crate) fn destructure_const<'tcx>(
|
||||
_ => bug!("cannot destructure constant {:?}", const_),
|
||||
};
|
||||
|
||||
let fields = tcx.arena.alloc_from_iter(fields.into_iter());
|
||||
let fields = tcx.arena.alloc_from_iter(fields);
|
||||
|
||||
ty::DestructuredConst { variant, fields }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user