Skip to content

Don't count variants/fields/consts/associated types in doc-coverage doc examples #75718

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Aug 22, 2020
Prev Previous commit
Show line even if there is no code examples
  • Loading branch information
GuillaumeGomez committed Aug 21, 2020
commit adeedf52435fe893156f93e2771dc66adf02abc9
8 changes: 3 additions & 5 deletions src/librustdoc/passes/calculate_doc_coverage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fn calculate_doc_coverage(krate: clean::Crate, ctx: &DocContext<'_>) -> clean::C
krate
}

#[derive(Default, Copy, Clone, Serialize)]
#[derive(Default, Copy, Clone, Serialize, Debug)]
struct ItemCount {
total: u64,
with_docs: u64,
Expand Down Expand Up @@ -155,14 +155,12 @@ impl CoverageCalculator {
print_table_line();

for (file, &count) in &self.items {
if let (Some(percentage), Some(examples_percentage)) =
(count.percentage(), count.examples_percentage())
{
if let Some(percentage) = count.percentage() {
print_table_record(
&limit_filename_len(file.to_string()),
count,
percentage,
examples_percentage,
count.examples_percentage().unwrap_or(0.),
);

total += count;
Expand Down