Simplify test result printing
This commit is contained in:
parent
f3247b2e9c
commit
6f5a56acd9
10
rust/main.rs
10
rust/main.rs
@ -30,12 +30,12 @@ fn main() {
|
||||
" {}: {}",
|
||||
n,
|
||||
if expected == output {
|
||||
let duration = if elapsed > Duration::from_millis(10) {
|
||||
format!(" ({:?})", elapsed)
|
||||
} else {
|
||||
"".to_owned()
|
||||
let mut s = String::from("OK");
|
||||
if elapsed > Duration::from_millis(10) {
|
||||
let d = format!(" ({:?})", elapsed);
|
||||
s = s + &d;
|
||||
};
|
||||
"OK".to_owned() + &duration
|
||||
s
|
||||
} else {
|
||||
format!("expected {}, got {}", expected, output)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user