From 78d60a549d0711ffea10e2898bff46ebc739f637 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 31 Aug 2018 15:10:37 +0300 Subject: default method name to type name --- crates/libsyntax2/src/ast/generated.rs.tera | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'crates/libsyntax2/src/ast/generated.rs.tera') diff --git a/crates/libsyntax2/src/ast/generated.rs.tera b/crates/libsyntax2/src/ast/generated.rs.tera index 69f9236b7..a72e9b732 100644 --- a/crates/libsyntax2/src/ast/generated.rs.tera +++ b/crates/libsyntax2/src/ast/generated.rs.tera @@ -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) } -- cgit v1.2.3