1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
use kdam::{BarExt, tqdm}; use std::io::Result; fn main() -> Result<()> { let mut pb = tqdm!(total = 10); for i in 0..10 { if i == 5 && pb.input("Break Loop [y/n]: ")?.trim() == "y" { break; } pb.update(1)?; } eprintln!(); Ok(()) }