This commit is contained in:
Aleksey Kladov 2018-08-22 17:01:51 +03:00
parent 8e3bec11eb
commit 69a524fbef
3 changed files with 28 additions and 45 deletions

View file

@ -58,9 +58,7 @@ impl<'a> {{ node }}<'a> {
{%- set method_name = m.0 -%}
{%- set ChildName = m.1 %}
pub fn {{ method_name }}(self) -> impl Iterator<Item = {{ ChildName }}<'a>> + 'a {
self.syntax()
.children()
.filter_map({{ ChildName }}::cast)
super::children(self)
}
{% endfor -%}
{%- endif -%}
@ -70,10 +68,7 @@ impl<'a> {{ node }}<'a> {
{%- set method_name = m.0 -%}
{%- set ChildName = m.1 %}
pub fn {{ method_name }}(self) -> Option<{{ ChildName }}<'a>> {
self.syntax()
.children()
.filter_map({{ ChildName }}::cast)
.next()
super::child_opt(self)
}
{% endfor -%}
{%- endif -%}