Simplify test result printing

This commit is contained in:
George Thomas 2025-12-23 15:11:52 +00:00
parent f3247b2e9c
commit 6f5a56acd9

View File

@ -30,12 +30,12 @@ fn main() {
" {}: {}", " {}: {}",
n, n,
if expected == output { if expected == output {
let duration = if elapsed > Duration::from_millis(10) { let mut s = String::from("OK");
format!(" ({:?})", elapsed) if elapsed > Duration::from_millis(10) {
} else { let d = format!(" ({:?})", elapsed);
"".to_owned() s = s + &d;
}; };
"OK".to_owned() + &duration s
} else { } else {
format!("expected {}, got {}", expected, output) format!("expected {}, got {}", expected, output)
} }