📄
src/progress.rs
use indicatif::{ProgressBar, ProgressStyle}; /// A single-line progress bar (elapsed time, bar, position/total, rate, ETA) in the /// style used by Brush's CLI, for a fixed-size loop with `len` items counted in `unit`. pub fn new(len: u64, unit: &str) -> ProgressBar { let template = format!("[{{elapsed_precise}}] {{bar:40.cyan/blue}} {{pos}}/{{len}} {unit} ({{per_sec}}, {{eta}} remaining)"); ProgressBar::new(len).with_style( ProgressStyle::with_template(&template) .expect("valid indicatif template") .progress_chars("◍○○"), ) }