Further simplification of the API

This commit is contained in:
David Peter authored and David Peter committed 2026-10-05 16:00:08 +02:00
1 parent 4badeb6312
commit ebf127338c
4 files changed
+51 -95

No files matched your search

+3 -7
View File
@@ -53,10 +53,9 @@ pub trait MarkupExporter {
let cmd_str = result.command_with_unused_parameters().replace('|', "\\|");
let mean_str = result
.mean_wall_clock_time()
.format_value_auto(Some(time_unit))
.0;
.format_value_auto(Some(time_unit));
let stddev_str = if let Some(stddev) = result.measurements.stddev() {
format!(" ± {}", stddev.format_value_auto(Some(time_unit)).0)
format!(" ± {}", stddev.format_value_auto(Some(time_unit)))
} else {
"".into()
};
@@ -117,10 +116,7 @@ pub trait MarkupExporter {
fn determine_unit_from_results(results: &[BenchmarkResult]) -> TimeUnit {
if let Some(first_result) = results.first() {
// Use the first BenchmarkResult entry to determine the unit for all entries.
first_result
.mean_wall_clock_time()
.format_auto_with_unit(None)
.1
first_result.mean_wall_clock_time().suitable_unit()
} else {
// Default to `Second`.
TimeUnit::Second