diff options
Diffstat (limited to 'crates/libsyntax2/src/ast/generated.rs')
-rw-r--r-- | crates/libsyntax2/src/ast/generated.rs | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/crates/libsyntax2/src/ast/generated.rs b/crates/libsyntax2/src/ast/generated.rs index d0e07fddc..0f53e8f4a 100644 --- a/crates/libsyntax2/src/ast/generated.rs +++ b/crates/libsyntax2/src/ast/generated.rs | |||
@@ -40,10 +40,7 @@ impl<'a> AstNode<'a> for Attr<'a> { | |||
40 | 40 | ||
41 | impl<'a> Attr<'a> { | 41 | impl<'a> Attr<'a> { |
42 | pub fn value(self) -> Option<TokenTree<'a>> { | 42 | pub fn value(self) -> Option<TokenTree<'a>> { |
43 | self.syntax() | 43 | super::child_opt(self) |
44 | .children() | ||
45 | .filter_map(TokenTree::cast) | ||
46 | .next() | ||
47 | } | 44 | } |
48 | } | 45 | } |
49 | 46 | ||
@@ -125,15 +122,11 @@ impl<'a> AstNode<'a> for File<'a> { | |||
125 | 122 | ||
126 | impl<'a> File<'a> { | 123 | impl<'a> File<'a> { |
127 | pub fn functions(self) -> impl Iterator<Item = FnDef<'a>> + 'a { | 124 | pub fn functions(self) -> impl Iterator<Item = FnDef<'a>> + 'a { |
128 | self.syntax() | 125 | super::children(self) |
129 | .children() | ||
130 | .filter_map(FnDef::cast) | ||
131 | } | 126 | } |
132 | 127 | ||
133 | pub fn modules(self) -> impl Iterator<Item = Module<'a>> + 'a { | 128 | pub fn modules(self) -> impl Iterator<Item = Module<'a>> + 'a { |
134 | self.syntax() | 129 | super::children(self) |
135 | .children() | ||
136 | .filter_map(Module::cast) | ||
137 | } | 130 | } |
138 | } | 131 | } |
139 | 132 | ||
@@ -250,9 +243,7 @@ impl<'a> ast::NameOwner<'a> for Module<'a> {} | |||
250 | impl<'a> ast::AttrsOwner<'a> for Module<'a> {} | 243 | impl<'a> ast::AttrsOwner<'a> for Module<'a> {} |
251 | impl<'a> Module<'a> { | 244 | impl<'a> Module<'a> { |
252 | pub fn modules(self) -> impl Iterator<Item = Module<'a>> + 'a { | 245 | pub fn modules(self) -> impl Iterator<Item = Module<'a>> + 'a { |
253 | self.syntax() | 246 | super::children(self) |
254 | .children() | ||
255 | .filter_map(Module::cast) | ||
256 | } | 247 | } |
257 | } | 248 | } |
258 | 249 | ||
@@ -507,9 +498,7 @@ impl<'a> ast::TypeParamsOwner<'a> for StructDef<'a> {} | |||
507 | impl<'a> ast::AttrsOwner<'a> for StructDef<'a> {} | 498 | impl<'a> ast::AttrsOwner<'a> for StructDef<'a> {} |
508 | impl<'a> StructDef<'a> { | 499 | impl<'a> StructDef<'a> { |
509 | pub fn fields(self) -> impl Iterator<Item = NamedField<'a>> + 'a { | 500 | pub fn fields(self) -> impl Iterator<Item = NamedField<'a>> + 'a { |
510 | self.syntax() | 501 | super::children(self) |
511 | .children() | ||
512 | .filter_map(NamedField::cast) | ||
513 | } | 502 | } |
514 | } | 503 | } |
515 | 504 | ||