From 12fe301a0cbe4ffecdabae1c9b827e740e3ce027 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 9 Mar 2021 18:06:08 +0300 Subject: Cleanup auto-ref in completion --- crates/hir/src/lib.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'crates/hir') diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index d5a3d9034..641ea4221 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs @@ -1614,10 +1614,9 @@ impl Type { } pub fn remove_ref(&self) -> Option { - if let Ty::Ref(.., substs) = &self.ty.value { - Some(self.derived(substs[0].clone())) - } else { - None + match &self.ty.value { + Ty::Ref(.., substs) => Some(self.derived(substs[0].clone())), + _ => None, } } -- cgit v1.2.3