1
0
Fork 0
mirror of https://github.com/rust-lang/rustlings.git synced 2024-05-23 16:56:12 +02:00

Merge pull request #1899 from kazu728/fix-verify-stdout-buffering

show stdout of the final line
This commit is contained in:
liv 2024-03-17 13:19:20 +01:00 committed by GitHub
commit 32d2c38aa2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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(())
}