diff options
Diffstat (limited to 'crates/ra_syntax/src/ast.rs')
-rw-r--r-- | crates/ra_syntax/src/ast.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs index 123a7a6b9..8bf439b60 100644 --- a/crates/ra_syntax/src/ast.rs +++ b/crates/ra_syntax/src/ast.rs | |||
@@ -348,6 +348,12 @@ impl UseTreeList { | |||
348 | } | 348 | } |
349 | } | 349 | } |
350 | 350 | ||
351 | impl RefPat { | ||
352 | pub fn is_mut(&self) -> bool { | ||
353 | self.syntax().children().any(|n| n.kind() == MUT_KW) | ||
354 | } | ||
355 | } | ||
356 | |||
351 | fn child_opt<P: AstNode, C: AstNode>(parent: &P) -> Option<&C> { | 357 | fn child_opt<P: AstNode, C: AstNode>(parent: &P) -> Option<&C> { |
352 | children(parent).next() | 358 | children(parent).next() |
353 | } | 359 | } |