diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs index 92c79df1567..3d0b7a827e7 100644 --- a/crates/ra_hir/src/ty/infer.rs +++ b/crates/ra_hir/src/ty/infer.rs @@ -681,12 +681,7 @@ fn infer_pat(&mut self, pat: PatId, mut expected: &Ty, mut default_bm: BindingMo let inner_ty = self.insert_type_vars_shallow(inner_ty); let bound_ty = match mode { - BindingMode::Ref(Mutability::Shared) => { - Ty::Ref(inner_ty.clone().into(), Mutability::Shared) - } - BindingMode::Ref(Mutability::Mut) => { - Ty::Ref(inner_ty.clone().into(), Mutability::Mut) - } + BindingMode::Ref(mutability) => Ty::Ref(inner_ty.clone().into(), mutability), BindingMode::Move => inner_ty.clone(), }; let bound_ty = self.resolve_ty_as_possible(&mut vec![], bound_ty);