aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-04-09 22:35:05 +0100
committerAleksey Kladov <[email protected]>2020-04-09 22:42:01 +0100
commit30084a56a5731343bd4cec727646a6c55900234f (patch)
treecca4821454502279317323fbc63dccdb9c68c5b9 /crates/ra_ide/src
parent00ec0c10669307bc752812f535f96e121338d688 (diff)
Simpler acessors for keywords
Diffstat (limited to 'crates/ra_ide/src')
-rw-r--r--crates/ra_ide/src/completion/completion_context.rs4
-rw-r--r--crates/ra_ide/src/references.rs2
2 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_ide/src/completion/completion_context.rs b/crates/ra_ide/src/completion/completion_context.rs
index 0e34d85db..6637afaf7 100644
--- a/crates/ra_ide/src/completion/completion_context.rs
+++ b/crates/ra_ide/src/completion/completion_context.rs
@@ -191,8 +191,8 @@ impl<'a> CompletionContext<'a> {
191 if let Some(bind_pat) = name.syntax().ancestors().find_map(ast::BindPat::cast) { 191 if let Some(bind_pat) = name.syntax().ancestors().find_map(ast::BindPat::cast) {
192 self.is_pat_binding_or_const = true; 192 self.is_pat_binding_or_const = true;
193 if bind_pat.at_token().is_some() 193 if bind_pat.at_token().is_some()
194 || bind_pat.ref_kw_token().is_some() 194 || bind_pat.ref_token().is_some()
195 || bind_pat.mut_kw_token().is_some() 195 || bind_pat.mut_token().is_some()
196 { 196 {
197 self.is_pat_binding_or_const = false; 197 self.is_pat_binding_or_const = false;
198 } 198 }
diff --git a/crates/ra_ide/src/references.rs b/crates/ra_ide/src/references.rs
index ad6fd50aa..7d0544ff4 100644
--- a/crates/ra_ide/src/references.rs
+++ b/crates/ra_ide/src/references.rs
@@ -152,7 +152,7 @@ fn decl_access(def: &Definition, syntax: &SyntaxNode, range: TextRange) -> Optio
152 if stmt.initializer().is_some() { 152 if stmt.initializer().is_some() {
153 let pat = stmt.pat()?; 153 let pat = stmt.pat()?;
154 if let ast::Pat::BindPat(it) = pat { 154 if let ast::Pat::BindPat(it) = pat {
155 if it.mut_kw_token().is_some() { 155 if it.mut_token().is_some() {
156 return Some(ReferenceAccess::Write); 156 return Some(ReferenceAccess::Write);
157 } 157 }
158 } 158 }