Skip to content

Commit 4425148

Browse files
committed
Use Instant::now lazily
1 parent 9f1269f commit 4425148

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libtest/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ fn run_test_in_process(
563563
None
564564
};
565565

566-
let start = report_time.then_some(Instant::now());
566+
let start = report_time.then(Instant::now);
567567
let result = catch_unwind(AssertUnwindSafe(testfn));
568568
let exec_time = start.map(|start| {
569569
let duration = start.elapsed();
@@ -594,7 +594,7 @@ fn spawn_test_subprocess(
594594
let args = env::args().collect::<Vec<_>>();
595595
let current_exe = &args[0];
596596

597-
let start = report_time.then_some(Instant::now());
597+
let start = report_time.then(Instant::now);
598598
let output = match Command::new(current_exe)
599599
.env(SECONDARY_TEST_INVOKER_VAR, desc.name.as_slice())
600600
.output() {

0 commit comments

Comments
 (0)