Skip to content

Commit 0177193

Browse files
committed
Show percent complete without decimal
1 parent 79a105a commit 0177193

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/console.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,12 +284,16 @@ impl nutmeg::Model for LabModel {
284284
}
285285
if let Some(lab_start_time) = self.lab_start_time {
286286
let elapsed = lab_start_time.elapsed();
287+
let percent = if self.n_mutants > 0 {
288+
((self.i_mutant.saturating_sub(1) as f64) / (self.n_mutants as f64) * 100.0)
289+
.round()
290+
} else {
291+
0.0
292+
};
287293
write!(
288294
s,
289-
"Trying mutant {}/{}, {} done",
290-
self.i_mutant,
291-
self.n_mutants,
292-
nutmeg::percent_done(self.i_mutant.saturating_sub(1), self.n_mutants),
295+
"Trying mutant {}/{}, {percent}% done",
296+
self.i_mutant, self.n_mutants,
293297
)
294298
.unwrap();
295299
if self.mutants_missed > 0 {

0 commit comments

Comments
 (0)