@@ -177,10 +177,7 @@ impl<'i> InterfaceGenerator<'i> {
177177 private : true ,
178178 ..Default :: default ( )
179179 } ;
180- if let FunctionKind :: Method ( _) = & func. kind {
181- sig. self_arg = Some ( "&self" . into ( ) ) ;
182- sig. self_is_first_param = true ;
183- }
180+ sig. update_for_func ( & func) ;
184181 self . print_signature ( func, true , & sig) ;
185182 self . src . push_str ( ";\n " ) ;
186183 let trait_method = mem:: replace ( & mut self . src , prev) ;
@@ -713,10 +710,7 @@ pub mod vtable{ordinal} {{
713710 let name = to_upper_camel_case ( name) ;
714711 uwriteln ! ( self . src, "impl {name} {{" ) ;
715712 sig. use_item_name = true ;
716- if let FunctionKind :: Method ( _) = & func. kind {
717- sig. self_arg = Some ( "&self" . into ( ) ) ;
718- sig. self_is_first_param = true ;
719- }
713+ sig. update_for_func ( & func) ;
720714 }
721715 self . src . push_str ( "#[allow(unused_unsafe, clippy::all)]\n " ) ;
722716 let params = self . print_signature ( func, async_, & sig) ;
@@ -1219,10 +1213,7 @@ unsafe fn call_import(params: *mut u8, results: *mut u8) -> u32 {{
12191213 private : true ,
12201214 ..Default :: default ( )
12211215 } ;
1222- if let FunctionKind :: Method ( _) = & func. kind {
1223- sig. self_arg = Some ( "&self" . into ( ) ) ;
1224- sig. self_is_first_param = true ;
1225- }
1216+ sig. update_for_func ( & func) ;
12261217 self . src . push_str ( "#[allow(unused_variables)]\n " ) ;
12271218 self . print_signature ( func, true , & sig) ;
12281219 self . src . push_str ( "{ unreachable!() }\n " ) ;
0 commit comments