dev_scripts/ui.rs
1use indicatif::{ProgressBar, ProgressStyle};
2
3/// Get a styled indicatif progress bar for reuse across the project.
4pub fn get_progress_bar(items: u64) -> ProgressBar {
5 let bar = ProgressBar::new(items);
6 bar.set_style(
7 ProgressStyle::with_template(
8 "{spinner:.green} [{elapsed_precise}] [{bar:40.cyan/blue}] ({pos}/{len}, ETA {eta})",
9 )
10 .expect("This progress syntax is valid"),
11 );
12
13 bar
14}