@@ -44,10 +44,6 @@ use utils::*;
44
44
pub ( crate ) use self :: types:: * ;
45
45
pub ( crate ) use self :: utils:: { get_auto_trait_and_blanket_impls, krate, register_res} ;
46
46
47
- pub ( crate ) trait Clean < ' tcx , T > {
48
- fn clean ( & self , cx : & mut DocContext < ' tcx > ) -> T ;
49
- }
50
-
51
47
pub ( crate ) fn clean_doc_module < ' tcx > ( doc : & DocModule < ' tcx > , cx : & mut DocContext < ' tcx > ) -> Item {
52
48
let mut items: Vec < Item > = vec ! [ ] ;
53
49
let mut inserted = FxHashSet :: default ( ) ;
@@ -1925,7 +1921,7 @@ fn clean_maybe_renamed_item<'tcx>(
1925
1921
} ) )
1926
1922
}
1927
1923
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 ( ) ,
1929
1925
generics : clean_generics ( generics, cx) ,
1930
1926
} ) ,
1931
1927
ItemKind :: TraitAlias ( generics, bounds) => TraitAliasItem ( TraitAlias {
@@ -1978,14 +1974,12 @@ fn clean_maybe_renamed_item<'tcx>(
1978
1974
} )
1979
1975
}
1980
1976
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 }
1989
1983
}
1990
1984
1991
1985
fn clean_impl < ' tcx > (
0 commit comments