default method name to type name

This commit is contained in:
Aleksey Kladov 2018-08-31 15:10:37 +03:00
parent 05a9d42f54
commit 78d60a549d
4 changed files with 51 additions and 84 deletions

View file

@ -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)
}