@@ -162,8 +162,8 @@ impl From<clean::ItemKind> for ItemEnum {
162
162
ForeignFunctionItem ( f) => ItemEnum :: FunctionItem ( f. into ( ) ) ,
163
163
TraitItem ( t) => ItemEnum :: TraitItem ( t. into ( ) ) ,
164
164
TraitAliasItem ( t) => ItemEnum :: TraitAliasItem ( t. into ( ) ) ,
165
- MethodItem ( m, _) => ItemEnum :: MethodItem ( m . into ( ) ) ,
166
- TyMethodItem ( m) => ItemEnum :: MethodItem ( m . into ( ) ) ,
165
+ MethodItem ( m, _) => ItemEnum :: MethodItem ( from_function_method ( m , true ) ) ,
166
+ TyMethodItem ( m) => ItemEnum :: MethodItem ( from_function_method ( m , false ) ) ,
167
167
ImplItem ( i) => ItemEnum :: ImplItem ( i. into ( ) ) ,
168
168
StaticItem ( s) => ItemEnum :: StaticItem ( s. into ( ) ) ,
169
169
ForeignStaticItem ( s) => ItemEnum :: StaticItem ( s. into ( ) ) ,
@@ -435,15 +435,13 @@ impl From<clean::Impl> for Impl {
435
435
}
436
436
}
437
437
438
- impl From < clean:: Function > for Method {
439
- fn from ( function : clean:: Function ) -> Self {
440
- let clean:: Function { header, decl, generics, all_types : _, ret_types : _ } = function;
441
- Method {
442
- decl : decl. into ( ) ,
443
- generics : generics. into ( ) ,
444
- header : stringify_header ( & header) ,
445
- has_body : true ,
446
- }
438
+ crate fn from_function_method ( function : clean:: Function , has_body : bool ) -> Method {
439
+ let clean:: Function { header, decl, generics, all_types : _, ret_types : _ } = function;
440
+ Method {
441
+ decl : decl. into ( ) ,
442
+ generics : generics. into ( ) ,
443
+ header : stringify_header ( & header) ,
444
+ has_body,
447
445
}
448
446
}
449
447
0 commit comments