From 814d617d348c23507fd444e58515c9bff6b73105 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Tue, 9 Mar 2021 16:33:41 +0100 Subject: Show whether a binding is mutable or not on hover --- crates/hir/src/lib.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'crates/hir') diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index d5a3d9034..caf4c3395 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs @@ -1296,13 +1296,7 @@ impl Local { pub fn is_mut(self, db: &dyn HirDatabase) -> bool { let body = db.body(self.parent.into()); - match &body[self.pat_id] { - Pat::Bind { mode, .. } => match mode { - BindingAnnotation::Mutable | BindingAnnotation::RefMut => true, - _ => false, - }, - _ => false, - } + matches!(&body[self.pat_id], Pat::Bind { mode: BindingAnnotation::Mutable, .. }) } pub fn parent(self, _db: &dyn HirDatabase) -> DefWithBody { -- cgit v1.2.3