Skip to content

Commit a41961c

Browse files
authored
Make metric header not be "( )" when there is no metric (#1409)
* Fix metric header to not be () when no metric
1 parent 5c0b0a3 commit a41961c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

site/src/comparison.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -532,11 +532,10 @@ pub fn write_summary_table(
532532
.relevant_comparisons
533533
.first()
534534
.or(secondary.relevant_comparisons.first())
535-
.map(|m| m.metric.as_str())
535+
.map(|m| format!("({})", m.metric.as_str()))
536536
})
537537
.flatten()
538-
// we want at least 10 spaces to accommodate "count[^2]"
539-
.unwrap_or(" ");
538+
.unwrap_or_else(|| String::from(" "));
540539

541540
fn render_stat<F: FnOnce() -> Option<f64>>(count: usize, calculate: F) -> String {
542541
let value = if count > 0 { calculate() } else { None };
@@ -640,7 +639,7 @@ pub fn write_summary_table(
640639
// This code attempts to space the table cells evenly so that the data is
641640
// easy to read for anyone who is viewing the Markdown source.
642641
let column_labels = [
643-
format!("({metric})"),
642+
metric,
644643
format!("mean{}", if with_footnotes { "[^1]" } else { "" }),
645644
"max".to_string(),
646645
format!("count{}", if with_footnotes { "[^2]" } else { "" }),

0 commit comments

Comments
 (0)