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 {
Some(res_assoc_ty) => {
let ty = self.table.new_type_var();
let mut builder = Substs::build_for_def(self.db, res_assoc_ty).push(inner_ty);
for ty in params {
builder = builder.push(ty.clone());
}
let builder = Substs::build_for_def(self.db, res_assoc_ty)
.push(inner_ty)
.fill(params.iter().cloned());
let projection = ProjectionPredicate {
ty: ty.clone(),
projection_ty: ProjectionTy {