Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions site/src/comparison.rs
Original file line number Diff line number Diff line change
Expand Up @@ -532,11 +532,10 @@ pub fn write_summary_table(
.relevant_comparisons
.first()
.or(secondary.relevant_comparisons.first())
.map(|m| m.metric.as_str())
.map(|m| format!("({})", m.metric.as_str()))
})
.flatten()
// we want at least 10 spaces to accommodate "count[^2]"
.unwrap_or(" ");
.unwrap_or_else(|| String::from(" "));

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