@@ -92,7 +92,7 @@ fn generate_builder_raw_impl(name: &Ident, data_enum: &DataEnum) -> TokenStream2
9292 let method = match & variant. fields {
9393 Fields :: Unit => {
9494 quote ! {
95- pub fn #method_name( mut self ) -> Self {
95+ pub fn #method_name( & mut self ) -> & mut Self {
9696 self . instructions. push( #name:: <Call >:: #variant_name) ;
9797 self
9898 }
@@ -107,7 +107,7 @@ fn generate_builder_raw_impl(name: &Ident, data_enum: &DataEnum) -> TokenStream2
107107 . collect ( ) ;
108108 let arg_types: Vec < _ > = fields. unnamed . iter ( ) . map ( |field| & field. ty ) . collect ( ) ;
109109 quote ! {
110- pub fn #method_name( mut self , #( #arg_names: #arg_types) , * ) -> Self {
110+ pub fn #method_name( & mut self , #( #arg_names: #arg_types) , * ) -> & mut Self {
111111 self . instructions. push( #name:: <Call >:: #variant_name( #( #arg_names) , * ) ) ;
112112 self
113113 }
@@ -117,7 +117,7 @@ fn generate_builder_raw_impl(name: &Ident, data_enum: &DataEnum) -> TokenStream2
117117 let arg_names: Vec < _ > = fields. named . iter ( ) . map ( |field| & field. ident ) . collect ( ) ;
118118 let arg_types: Vec < _ > = fields. named . iter ( ) . map ( |field| & field. ty ) . collect ( ) ;
119119 quote ! {
120- pub fn #method_name( mut self , #( #arg_names: #arg_types) , * ) -> Self {
120+ pub fn #method_name( & mut self , #( #arg_names: #arg_types) , * ) -> & mut Self {
121121 self . instructions. push( #name:: <Call >:: #variant_name { #( #arg_names) , * } ) ;
122122 self
123123 }
0 commit comments