Skip to content

Commit 4b7fe4a

Browse files
remove Clean trait implementation for hir::Variant
1 parent 2fbc08e commit 4b7fe4a

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/librustdoc/clean/mod.rs

+7-9
Original file line numberDiff line numberDiff line change
@@ -1925,7 +1925,7 @@ fn clean_maybe_renamed_item<'tcx>(
19251925
}))
19261926
}
19271927
ItemKind::Enum(ref def, generics) => EnumItem(Enum {
1928-
variants: def.variants.iter().map(|v| v.clean(cx)).collect(),
1928+
variants: def.variants.iter().map(|v| clean_variant(v, cx)).collect(),
19291929
generics: clean_generics(generics, cx),
19301930
}),
19311931
ItemKind::TraitAlias(generics, bounds) => TraitAliasItem(TraitAlias {
@@ -1978,14 +1978,12 @@ fn clean_maybe_renamed_item<'tcx>(
19781978
})
19791979
}
19801980

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-
}
1981+
fn clean_variant<'tcx>(variant: &hir::Variant<'tcx>, cx: &mut DocContext<'tcx>) -> Item {
1982+
let kind = VariantItem(clean_variant_data(&variant.data, cx));
1983+
let what_rustc_thinks =
1984+
Item::from_hir_id_and_parts(variant.id, Some(variant.ident.name), kind, cx);
1985+
// don't show `pub` for variants, which are always public
1986+
Item { visibility: Inherited, ..what_rustc_thinks }
19891987
}
19901988

19911989
fn clean_impl<'tcx>(

0 commit comments

Comments
 (0)