Skip to content

Commit

Permalink
remove Clean trait implementation for hir::Variant
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Aug 14, 2022
1 parent 2fbc08e commit 4b7fe4a
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/librustdoc/clean/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1925,7 +1925,7 @@ fn clean_maybe_renamed_item<'tcx>(
}))
}
ItemKind::Enum(ref def, generics) => EnumItem(Enum {
variants: def.variants.iter().map(|v| v.clean(cx)).collect(),
variants: def.variants.iter().map(|v| clean_variant(v, cx)).collect(),
generics: clean_generics(generics, cx),
}),
ItemKind::TraitAlias(generics, bounds) => TraitAliasItem(TraitAlias {
Expand Down Expand Up @@ -1978,14 +1978,12 @@ fn clean_maybe_renamed_item<'tcx>(
})
}

impl<'tcx> Clean<'tcx, Item> for hir::Variant<'tcx> {
fn clean(&self, cx: &mut DocContext<'tcx>) -> Item {
let kind = VariantItem(clean_variant_data(&self.data, cx));
let what_rustc_thinks =
Item::from_hir_id_and_parts(self.id, Some(self.ident.name), kind, cx);
// don't show `pub` for variants, which are always public
Item { visibility: Inherited, ..what_rustc_thinks }
}
fn clean_variant<'tcx>(variant: &hir::Variant<'tcx>, cx: &mut DocContext<'tcx>) -> Item {
let kind = VariantItem(clean_variant_data(&variant.data, cx));
let what_rustc_thinks =
Item::from_hir_id_and_parts(variant.id, Some(variant.ident.name), kind, cx);
// don't show `pub` for variants, which are always public
Item { visibility: Inherited, ..what_rustc_thinks }
}

fn clean_impl<'tcx>(
Expand Down

0 comments on commit 4b7fe4a

Please sign in to comment.