aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax')
-rw-r--r--crates/ra_syntax/src/ast.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs
index 20e0a6856..56fb7c20c 100644
--- a/crates/ra_syntax/src/ast.rs
+++ b/crates/ra_syntax/src/ast.rs
@@ -724,6 +724,12 @@ impl LiteralExpr {
724 } 724 }
725} 725}
726 726
727impl NamedField {
728 pub fn parent_struct_lit(&self) -> &StructLit {
729 self.syntax().ancestors().find_map(StructLit::cast).unwrap()
730 }
731}
732
727impl BindPat { 733impl BindPat {
728 pub fn is_mutable(&self) -> bool { 734 pub fn is_mutable(&self) -> bool {
729 self.syntax().children().any(|n| n.kind() == MUT_KW) 735 self.syntax().children().any(|n| n.kind() == MUT_KW)