diff options
Diffstat (limited to 'crates/ra_syntax/src/ast')
-rw-r--r-- | crates/ra_syntax/src/ast/extensions.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/ast/extensions.rs b/crates/ra_syntax/src/ast/extensions.rs index 2a59cf653..efe261fc2 100644 --- a/crates/ra_syntax/src/ast/extensions.rs +++ b/crates/ra_syntax/src/ast/extensions.rs | |||
@@ -382,6 +382,18 @@ impl ast::WherePred { | |||
382 | } | 382 | } |
383 | } | 383 | } |
384 | 384 | ||
385 | impl ast::TypeBound { | ||
386 | pub fn question_mark_token(&self) -> Option<SyntaxToken> { | ||
387 | self.syntax() | ||
388 | .children_with_tokens() | ||
389 | .filter_map(|it| it.into_token()) | ||
390 | .find(|it| it.kind() == T![?]) | ||
391 | } | ||
392 | pub fn has_question_mark(&self) -> bool { | ||
393 | self.question_mark_token().is_some() | ||
394 | } | ||
395 | } | ||
396 | |||
385 | impl ast::TraitDef { | 397 | impl ast::TraitDef { |
386 | pub fn is_auto(&self) -> bool { | 398 | pub fn is_auto(&self) -> bool { |
387 | self.syntax().children_with_tokens().any(|t| t.kind() == T![auto]) | 399 | self.syntax().children_with_tokens().any(|t| t.kind() == T![auto]) |