@@ -177,10 +177,7 @@ impl<'i> InterfaceGenerator<'i> {
177
177
private : true ,
178
178
..Default :: default ( )
179
179
} ;
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) ;
184
181
self . print_signature ( func, true , & sig) ;
185
182
self . src . push_str ( ";\n " ) ;
186
183
let trait_method = mem:: replace ( & mut self . src , prev) ;
@@ -713,10 +710,7 @@ pub mod vtable{ordinal} {{
713
710
let name = to_upper_camel_case ( name) ;
714
711
uwriteln ! ( self . src, "impl {name} {{" ) ;
715
712
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) ;
720
714
}
721
715
self . src . push_str ( "#[allow(unused_unsafe, clippy::all)]\n " ) ;
722
716
let params = self . print_signature ( func, async_, & sig) ;
@@ -1219,10 +1213,7 @@ unsafe fn call_import(params: *mut u8, results: *mut u8) -> u32 {{
1219
1213
private : true ,
1220
1214
..Default :: default ( )
1221
1215
} ;
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) ;
1226
1217
self . src . push_str ( "#[allow(unused_variables)]\n " ) ;
1227
1218
self . print_signature ( func, true , & sig) ;
1228
1219
self . src . push_str ( "{ unreachable!() }\n " ) ;
0 commit comments