Simplify match statement.

This commit is contained in:
Michael Killough 2019-03-17 18:50:22 +00:00
parent 354134ffb4
commit 33add0ee30

View File

@ -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);