Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir_ty/src/infer/unify.rs')
| -rw-r--r-- | crates/hir_ty/src/infer/unify.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/hir_ty/src/infer/unify.rs b/crates/hir_ty/src/infer/unify.rs index 4c1e758904..c40ef7f587 100644 --- a/crates/hir_ty/src/infer/unify.rs +++ b/crates/hir_ty/src/infer/unify.rs @@ -324,10 +324,9 @@ impl<'a> InferenceTable<'a> { /// Unify two types and register new trait goals that arise from that. pub(crate) fn unify(&mut self, ty1: &Ty, ty2: &Ty) -> bool { - let result = if let Ok(r) = self.try_unify(ty1, ty2) { - r - } else { - return false; + let result = match self.try_unify(ty1, ty2) { + Ok(r) => r, + Err(_) => return false, }; self.register_infer_ok(result); true |