Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir_ty/src/autoderef.rs')
| -rw-r--r-- | crates/hir_ty/src/autoderef.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/hir_ty/src/autoderef.rs b/crates/hir_ty/src/autoderef.rs index e3f008645c..4dc46a2cde 100644 --- a/crates/hir_ty/src/autoderef.rs +++ b/crates/hir_ty/src/autoderef.rs @@ -109,10 +109,9 @@ pub(crate) fn deref( ty: InEnvironment<&Canonical<Ty>>, ) -> Option<Canonical<Ty>> { let _p = profile::span("deref"); - if let Some(derefed) = builtin_deref(&ty.goal.value) { - Some(Canonical { value: derefed, binders: ty.goal.binders.clone() }) - } else { - deref_by_trait(db, krate, ty) + match builtin_deref(&ty.goal.value) { + Some(derefed) => Some(Canonical { value: derefed, binders: ty.goal.binders.clone() }), + None => deref_by_trait(db, krate, ty), } } |