diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-03-09 16:23:51 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-03-09 16:23:51 +0000 |
commit | c45ac6effe37562daa97e6675c54963252f65664 (patch) | |
tree | 9f00979cde7fa508ab0b583fa0deeaa79236b7db /crates/hir/src | |
parent | c2359608c926d4828f2b112e7069978449851d58 (diff) | |
parent | 814d617d348c23507fd444e58515c9bff6b73105 (diff) |
Merge #7942
7942: Show whether a binding is mutable or not on hover r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/hir/src')
-rw-r--r-- | crates/hir/src/lib.rs | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index 641ea4221..638398e29 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs | |||
@@ -1296,13 +1296,7 @@ impl Local { | |||
1296 | 1296 | ||
1297 | pub fn is_mut(self, db: &dyn HirDatabase) -> bool { | 1297 | pub fn is_mut(self, db: &dyn HirDatabase) -> bool { |
1298 | let body = db.body(self.parent.into()); | 1298 | let body = db.body(self.parent.into()); |
1299 | match &body[self.pat_id] { | 1299 | matches!(&body[self.pat_id], Pat::Bind { mode: BindingAnnotation::Mutable, .. }) |
1300 | Pat::Bind { mode, .. } => match mode { | ||
1301 | BindingAnnotation::Mutable | BindingAnnotation::RefMut => true, | ||
1302 | _ => false, | ||
1303 | }, | ||
1304 | _ => false, | ||
1305 | } | ||
1306 | } | 1300 | } |
1307 | 1301 | ||
1308 | pub fn parent(self, _db: &dyn HirDatabase) -> DefWithBody { | 1302 | pub fn parent(self, _db: &dyn HirDatabase) -> DefWithBody { |