mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +00:00
dedupe
This commit is contained in:
parent
8e3bec11eb
commit
69a524fbef
3 changed files with 28 additions and 45 deletions
|
@ -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 -%}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue