@@ -44,10 +44,6 @@ use utils::*;
4444pub ( crate ) use self :: types:: * ;
4545pub ( crate ) use self :: utils:: { get_auto_trait_and_blanket_impls, krate, register_res} ;
4646
47- pub ( crate ) trait Clean < ' tcx , T > {
48- fn clean ( & self , cx : & mut DocContext < ' tcx > ) -> T ;
49- }
50-
5147pub ( crate ) fn clean_doc_module < ' tcx > ( doc : & DocModule < ' tcx > , cx : & mut DocContext < ' tcx > ) -> Item {
5248 let mut items: Vec < Item > = vec ! [ ] ;
5349 let mut inserted = FxHashSet :: default ( ) ;
@@ -1925,7 +1921,7 @@ fn clean_maybe_renamed_item<'tcx>(
19251921 } ) )
19261922 }
19271923 ItemKind :: Enum ( ref def, generics) => EnumItem ( Enum {
1928- variants : def. variants . iter ( ) . map ( |v| v . clean ( cx) ) . collect ( ) ,
1924+ variants : def. variants . iter ( ) . map ( |v| clean_variant ( v , cx) ) . collect ( ) ,
19291925 generics : clean_generics ( generics, cx) ,
19301926 } ) ,
19311927 ItemKind :: TraitAlias ( generics, bounds) => TraitAliasItem ( TraitAlias {
@@ -1978,14 +1974,12 @@ fn clean_maybe_renamed_item<'tcx>(
19781974 } )
19791975}
19801976
1981- impl < ' tcx > Clean < ' tcx , Item > for hir:: Variant < ' tcx > {
1982- fn clean ( & self , cx : & mut DocContext < ' tcx > ) -> Item {
1983- let kind = VariantItem ( clean_variant_data ( & self . data , cx) ) ;
1984- let what_rustc_thinks =
1985- Item :: from_hir_id_and_parts ( self . id , Some ( self . ident . name ) , kind, cx) ;
1986- // don't show `pub` for variants, which are always public
1987- Item { visibility : Inherited , ..what_rustc_thinks }
1988- }
1977+ fn clean_variant < ' tcx > ( variant : & hir:: Variant < ' tcx > , cx : & mut DocContext < ' tcx > ) -> Item {
1978+ let kind = VariantItem ( clean_variant_data ( & variant. data , cx) ) ;
1979+ let what_rustc_thinks =
1980+ Item :: from_hir_id_and_parts ( variant. id , Some ( variant. ident . name ) , kind, cx) ;
1981+ // don't show `pub` for variants, which are always public
1982+ Item { visibility : Inherited , ..what_rustc_thinks }
19891983}
19901984
19911985fn clean_impl < ' tcx > (
0 commit comments