Use fill instread of for loop

This commit is contained in:
Edwin Cheng 2019-12-20 03:04:55 +08:00
parent b61ad6a964
commit 76d688a328

View file

@ -375,11 +375,9 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
match assoc_ty { match assoc_ty {
Some(res_assoc_ty) => { Some(res_assoc_ty) => {
let ty = self.table.new_type_var(); let ty = self.table.new_type_var();
let mut builder = Substs::build_for_def(self.db, res_assoc_ty).push(inner_ty); let builder = Substs::build_for_def(self.db, res_assoc_ty)
for ty in params { .push(inner_ty)
builder = builder.push(ty.clone()); .fill(params.iter().cloned());
}
let projection = ProjectionPredicate { let projection = ProjectionPredicate {
ty: ty.clone(), ty: ty.clone(),
projection_ty: ProjectionTy { projection_ty: ProjectionTy {