File tree 1 file changed +17
-16
lines changed
1 file changed +17
-16
lines changed Original file line number Diff line number Diff line change @@ -783,7 +783,7 @@ fn clean_function(
783
783
let ( generics, decl) = enter_impl_trait ( cx, |cx| {
784
784
// NOTE: generics must be cleaned before args
785
785
let generics = generics. clean ( cx) ;
786
- let args = ( sig. decl . inputs , body_id) . clean ( cx ) ;
786
+ let args = clean_args_from_types_and_body_id ( cx , sig. decl . inputs , body_id) ;
787
787
let decl = clean_fn_decl_with_args ( cx, sig. decl , args) ;
788
788
( generics, decl)
789
789
} ) ;
@@ -810,22 +810,23 @@ fn clean_args_from_types_and_names(
810
810
}
811
811
}
812
812
813
- impl < ' a > Clean < Arguments > for ( & ' a [ hir:: Ty < ' a > ] , hir:: BodyId ) {
814
- fn clean ( & self , cx : & mut DocContext < ' _ > ) -> Arguments {
815
- let body = cx. tcx . hir ( ) . body ( self . 1 ) ;
813
+ fn clean_args_from_types_and_body_id (
814
+ cx : & mut DocContext < ' _ > ,
815
+ types : & [ hir:: Ty < ' _ > ] ,
816
+ body_id : hir:: BodyId ,
817
+ ) -> Arguments {
818
+ let body = cx. tcx . hir ( ) . body ( body_id) ;
816
819
817
- Arguments {
818
- values : self
819
- . 0
820
- . iter ( )
821
- . enumerate ( )
822
- . map ( |( i, ty) | Argument {
823
- name : name_from_pat ( body. params [ i] . pat ) ,
824
- type_ : ty. clean ( cx) ,
825
- is_const : false ,
826
- } )
827
- . collect ( ) ,
828
- }
820
+ Arguments {
821
+ values : types
822
+ . iter ( )
823
+ . enumerate ( )
824
+ . map ( |( i, ty) | Argument {
825
+ name : name_from_pat ( body. params [ i] . pat ) ,
826
+ type_ : ty. clean ( cx) ,
827
+ is_const : false ,
828
+ } )
829
+ . collect ( ) ,
829
830
}
830
831
}
831
832
You can’t perform that action at this time.
0 commit comments