diff options
author | Edwin Cheng <[email protected]> | 2019-12-19 19:04:55 +0000 |
---|---|---|
committer | Edwin Cheng <[email protected]> | 2019-12-19 19:04:55 +0000 |
commit | 76d688a328ab53b6264f9e489b88524377a7271d (patch) | |
tree | 7b60e078887c0eab4750a4e4e5a2a82a90e496ea /crates | |
parent | b61ad6a96430f82e9724c1831d7402705145750e (diff) |
Use fill instread of for loop
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_hir_ty/src/infer.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/crates/ra_hir_ty/src/infer.rs b/crates/ra_hir_ty/src/infer.rs index 98baeed6f..bbbc391c4 100644 --- a/crates/ra_hir_ty/src/infer.rs +++ b/crates/ra_hir_ty/src/infer.rs | |||
@@ -375,11 +375,9 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
375 | match assoc_ty { | 375 | match assoc_ty { |
376 | Some(res_assoc_ty) => { | 376 | Some(res_assoc_ty) => { |
377 | let ty = self.table.new_type_var(); | 377 | let ty = self.table.new_type_var(); |
378 | let mut builder = Substs::build_for_def(self.db, res_assoc_ty).push(inner_ty); | 378 | let builder = Substs::build_for_def(self.db, res_assoc_ty) |
379 | for ty in params { | 379 | .push(inner_ty) |
380 | builder = builder.push(ty.clone()); | 380 | .fill(params.iter().cloned()); |
381 | } | ||
382 | |||
383 | let projection = ProjectionPredicate { | 381 | let projection = ProjectionPredicate { |
384 | ty: ty.clone(), | 382 | ty: ty.clone(), |
385 | projection_ty: ProjectionTy { | 383 | projection_ty: ProjectionTy { |