rustdoc: tweak stability summary counting

This commit slightly tweaks the counting of impl blocks and structs for
the stability summary (so that the block itself isn't counted for
inherent impls, and the fields aren't counted for structs).
This commit is contained in:
Aaron Turon 2014-11-14 20:54:27 -08:00
parent 4caffa8526
commit 60741e0fa0

View file

@ -146,13 +146,12 @@ fn summarize_item(item: &Item) -> (Counts, Option<ModuleSummary>) {
// considered to have no children.
match item.inner {
// Require explicit `pub` to be visible
StructItem(Struct { fields: ref subitems, .. }) |
ImplItem(Impl { items: ref subitems, trait_: None, .. }) => {
let subcounts = subitems.iter().filter(|i| visible(*i))
.map(summarize_item)
.map(|s| s.val0())
.fold(Counts::zero(), |acc, x| acc + x);
(item_counts + subcounts, None)
(subcounts, None)
}
// `pub` automatically
EnumItem(Enum { variants: ref subitems, .. }) => {