aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src
diff options
context:
space:
mode:
authorTomasKralCZ <[email protected]>2020-01-19 17:55:56 +0000
committerTomasKralCZ <[email protected]>2020-01-19 17:55:56 +0000
commitf67ee69777e53ca1121e6aa461ecf84a3c01e139 (patch)
tree808b2ca3bff4a299a4997a5f1f4847d072f0e42c /crates/ra_syntax/src
parent514df15d9e32e057ba23dda0d4f5c07e82e7ed23 (diff)
added eq_token() method to LetStmt
Diffstat (limited to 'crates/ra_syntax/src')
-rw-r--r--crates/ra_syntax/src/ast/extensions.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/ast/extensions.rs b/crates/ra_syntax/src/ast/extensions.rs
index d9666cdca..b8043b726 100644
--- a/crates/ra_syntax/src/ast/extensions.rs
+++ b/crates/ra_syntax/src/ast/extensions.rs
@@ -234,6 +234,13 @@ impl ast::LetStmt {
234 Some(node) => node.kind() == T![;], 234 Some(node) => node.kind() == T![;],
235 } 235 }
236 } 236 }
237
238 pub fn eq_token(&self) -> Option<SyntaxToken> {
239 self.syntax()
240 .descendants_with_tokens()
241 .find(|t| t.kind() == EQ)
242 .and_then(|it| it.into_token())
243 }
237} 244}
238 245
239impl ast::ExprStmt { 246impl ast::ExprStmt {