Avoid a useless clone of UserTypeProjection

This commit is contained in:
Zalathar 2025-02-16 21:49:33 +11:00
parent bf3bb5fd37
commit a64efc72d0
2 changed files with 4 additions and 7 deletions

View file

@ -1516,8 +1516,8 @@ impl<'tcx> UserTypeProjections {
self.contents.iter().map(|&(ref user_type, _span)| user_type)
}
pub fn push_projection(mut self, user_ty: &UserTypeProjection, span: Span) -> Self {
self.contents.push((user_ty.clone(), span));
pub fn push_user_type(mut self, base_user_ty: UserTypeAnnotationIndex, span: Span) -> Self {
self.contents.push((UserTypeProjection { base: base_user_ty, projs: vec![] }, span));
self
}