mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +00:00
default method name to type name
This commit is contained in:
parent
05a9d42f54
commit
78d60a549d
4 changed files with 51 additions and 84 deletions
|
@ -65,8 +65,15 @@ impl<'a> {{ node }}<'a> {
|
|||
|
||||
{%- if methods.options -%}
|
||||
{%- for m in methods.options -%}
|
||||
|
||||
{%- if m is string -%}
|
||||
{%- set method_name = m | snake -%}
|
||||
{%- set ChildName = m %}
|
||||
{%- else -%}
|
||||
{%- set method_name = m.0 -%}
|
||||
{%- set ChildName = m.1 %}
|
||||
{%- endif -%}
|
||||
|
||||
pub fn {{ method_name }}(self) -> Option<{{ ChildName }}<'a>> {
|
||||
super::child_opt(self)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue