summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorliv <mokou@fastmail.com>2024-03-17 13:19:20 +0100
committerGitHub <noreply@github.com>2024-03-17 13:19:20 +0100
commit32d2c38aa236d2c65ad25aa4cb6dde9fd23dd0b6 (patch)
tree5f32c336feec1b58022c146a92b7ee097564181e
parentc723bcd594f4998caaf009670123b2aae741a177 (diff)
parent80388c042bd1c0048fccf1cf739486642969b8a7 (diff)
Merge pull request #1899 from kazu728/fix-verify-stdout-buffering
show stdout of the final line
-rw-r--r--src/verify.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/verify.rs b/src/verify.rs
index 8a2ad49..aee2afa 100644
--- a/src/verify.rs
+++ b/src/verify.rs
@@ -38,6 +38,15 @@ pub fn verify<'a>(
percentage += 100.0 / total as f32;
bar.inc(1);
bar.set_message(format!("({:.1} %)", percentage));
+ if bar.position() == total as u64 {
+ println!(
+ "Progress: You completed {} / {} exercises ({:.1} %).",
+ bar.position(),
+ total,
+ percentage
+ );
+ bar.finish();
+ }
}
Ok(())
}