aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-02-24 14:01:56 +0000
committerAleksey Kladov <[email protected]>2019-02-24 14:01:56 +0000
commit65a2be49539375502ca95c8da455f50f580df2e3 (patch)
treef5e07db7d5ddbc920a5d768f516bf3b6097ad817 /crates/ra_syntax
parent666303faf3c8b4215fde884451688084e298d6a8 (diff)
complete struct literals
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)