1
Fork 0

Replace some uses of vec.drain(..) with vec.into_iter()

IntoIter should optimize better than Drain
This commit is contained in:
The8472 2021-11-06 18:42:07 +01:00
parent d22dd65835
commit ff87ff962c
2 changed files with 6 additions and 6 deletions

View file

@ -2665,7 +2665,7 @@ impl<'tcx> UserTypeProjections {
mut self,
mut f: impl FnMut(UserTypeProjection) -> UserTypeProjection,
) -> Self {
self.contents = self.contents.drain(..).map(|(proj, span)| (f(proj), span)).collect();
self.contents = self.contents.into_iter().map(|(proj, span)| (f(proj), span)).collect();
self
}