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:
parent
4caffa8526
commit
60741e0fa0
1 changed files with 1 additions and 2 deletions
|
@ -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, .. }) => {
|
||||
|
|
Loading…
Reference in a new issue