From a8008feaf37f0abe846bb435ceef7f1b891030f0 Mon Sep 17 00:00:00 2001 From: Duncan Tourolle Date: Sun, 30 Aug 2026 13:13:57 +0200 Subject: [PATCH] Inline the verdict header, and take the formatter's pass clippy::print_literal on the results table header, and rustfmt's first look at code whose author could not run cargo. The four constructs the author flagged as risky -- scoped-thread lanes, a seventeen-argument params!, is_some_and over a closure, a refutable let-else -- all compiled untouched. Co-Authored-By: Claude Opus 5 (1M context) --- tools/bench/src/main.rs | 13 +++++++------ tools/bench/src/memory.rs | 5 ++++- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/tools/bench/src/main.rs b/tools/bench/src/main.rs index ef4e14a..48f13da 100644 --- a/tools/bench/src/main.rs +++ b/tools/bench/src/main.rs @@ -331,7 +331,10 @@ fn collect( v.insert("catalog_filtered_ms".to_string(), open.filtered_ms); let ips = thumbs.images_per_second; v.insert("thumbnail_throughput_ips".to_string(), ips); - v.insert("thumbnail_per_image_p99_ms".to_string(), thumbs.per_image.p99); + v.insert( + "thumbnail_per_image_p99_ms".to_string(), + thumbs.per_image.p99, + ); for row in exports { v.insert(row.key.to_string(), row.times.p99); } @@ -472,8 +475,8 @@ fn print_verdict( } println!(); println!( - " {:<30} {:>12} {:>13} {:>12} {:>8} {}", - "metric", "measured", "budget", "baseline", "drift", "verdict" + " {:<30} {:>12} {:>13} {:>12} {:>8} verdict", + "metric", "measured", "budget", "baseline", "drift" ); let mut failures = Vec::new(); @@ -521,9 +524,7 @@ fn print_verdict( "ok" }); } - println!( - " {key:<30} {measured:>12.2} {budget:>13} {recorded:>12} {drift:>8} {verdict}" - ); + println!(" {key:<30} {measured:>12.2} {budget:>13} {recorded:>12} {drift:>8} {verdict}"); } // A metric in the file that nothing measured is a harness that has drifted diff --git a/tools/bench/src/memory.rs b/tools/bench/src/memory.rs index da4067b..7c57e78 100644 --- a/tools/bench/src/memory.rs +++ b/tools/bench/src/memory.rs @@ -173,7 +173,10 @@ pub fn in_a_fresh_process(catalog_path: &Path) -> Result { .and_then(|v| v.parse::().ok()) }; let (Some(now_kb), Some(peak_kb)) = (field("rss_kb="), field("peak_kb=")) else { - anyhow::bail!("the memory probe printed something unreadable: {}", text.trim()); + anyhow::bail!( + "the memory probe printed something unreadable: {}", + text.trim() + ); }; Ok(Rss { now_kb, peak_kb }) }