From 3a55b5bf01ddc581a3f00fa56db725db93a131c6 Mon Sep 17 00:00:00 2001 From: Shotaro Yamada Date: Mon, 14 Oct 2019 19:50:12 +0900 Subject: make_mut_slice --- crates/ra_hir/src/ty/infer/unify.rs | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'crates/ra_hir/src/ty/infer') diff --git a/crates/ra_hir/src/ty/infer/unify.rs b/crates/ra_hir/src/ty/infer/unify.rs index 5e86ed260..014c7981f 100644 --- a/crates/ra_hir/src/ty/infer/unify.rs +++ b/crates/ra_hir/src/ty/infer/unify.rs @@ -6,7 +6,7 @@ use crate::ty::{ Canonical, InEnvironment, InferTy, ProjectionPredicate, ProjectionTy, Substs, TraitRef, Ty, TypeWalk, }; -use crate::util::make_mut_arc_slice; +use crate::util::make_mut_slice; impl<'a, D: HirDatabase> InferenceContext<'a, D> { pub(super) fn canonicalizer<'b>(&'b mut self) -> Canonicalizer<'a, 'b, D> @@ -76,11 +76,9 @@ where } fn do_canonicalize_trait_ref(&mut self, mut trait_ref: TraitRef) -> TraitRef { - make_mut_arc_slice(&mut trait_ref.substs.0, |tys| { - for ty in tys { - *ty = self.do_canonicalize_ty(ty.clone()); - } - }); + for ty in make_mut_slice(&mut trait_ref.substs.0) { + *ty = self.do_canonicalize_ty(ty.clone()); + } trait_ref } @@ -92,11 +90,9 @@ where } fn do_canonicalize_projection_ty(&mut self, mut projection_ty: ProjectionTy) -> ProjectionTy { - make_mut_arc_slice(&mut projection_ty.parameters.0, |params| { - for ty in params { - *ty = self.do_canonicalize_ty(ty.clone()); - } - }); + for ty in make_mut_slice(&mut projection_ty.parameters.0) { + *ty = self.do_canonicalize_ty(ty.clone()); + } projection_ty } -- cgit v1.2.3