@@ -162,8 +162,8 @@ impl From<clean::ItemKind> for ItemEnum {
162162 ForeignFunctionItem ( f) => ItemEnum :: FunctionItem ( f. into ( ) ) ,
163163 TraitItem ( t) => ItemEnum :: TraitItem ( t. into ( ) ) ,
164164 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 ) ) ,
167167 ImplItem ( i) => ItemEnum :: ImplItem ( i. into ( ) ) ,
168168 StaticItem ( s) => ItemEnum :: StaticItem ( s. into ( ) ) ,
169169 ForeignStaticItem ( s) => ItemEnum :: StaticItem ( s. into ( ) ) ,
@@ -435,15 +435,13 @@ impl From<clean::Impl> for Impl {
435435 }
436436}
437437
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,
447445 }
448446}
449447
0 commit comments