Show line even if there is no code examples
This commit is contained in:
parent
b20b6f8714
commit
adeedf5243
1 changed files with 3 additions and 5 deletions
|
@ -27,7 +27,7 @@ fn calculate_doc_coverage(krate: clean::Crate, ctx: &DocContext<'_>) -> clean::C
|
||||||
krate
|
krate
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default, Copy, Clone, Serialize)]
|
#[derive(Default, Copy, Clone, Serialize, Debug)]
|
||||||
struct ItemCount {
|
struct ItemCount {
|
||||||
total: u64,
|
total: u64,
|
||||||
with_docs: u64,
|
with_docs: u64,
|
||||||
|
@ -155,14 +155,12 @@ impl CoverageCalculator {
|
||||||
print_table_line();
|
print_table_line();
|
||||||
|
|
||||||
for (file, &count) in &self.items {
|
for (file, &count) in &self.items {
|
||||||
if let (Some(percentage), Some(examples_percentage)) =
|
if let Some(percentage) = count.percentage() {
|
||||||
(count.percentage(), count.examples_percentage())
|
|
||||||
{
|
|
||||||
print_table_record(
|
print_table_record(
|
||||||
&limit_filename_len(file.to_string()),
|
&limit_filename_len(file.to_string()),
|
||||||
count,
|
count,
|
||||||
percentage,
|
percentage,
|
||||||
examples_percentage,
|
count.examples_percentage().unwrap_or(0.),
|
||||||
);
|
);
|
||||||
|
|
||||||
total += count;
|
total += count;
|
||||||
|
|
Loading…
Add table
Reference in a new issue