Skip to main content

crab_clean/utils/
progress.rs

1use indicatif::{ProgressBar, ProgressStyle};
2use std::time::Duration;
3
4pub fn create_progress_bar(message: &str) -> ProgressBar {
5    let pb = ProgressBar::new_spinner();
6    pb.enable_steady_tick(Duration::from_millis(120));
7    pb.set_style(
8        ProgressStyle::with_template("{spinner:.blue} {msg}")
9            .unwrap()
10            .tick_strings(&[
11                "▹▹▹▹▹",
12                "▸▹▹▹▹",
13                "▹▸▹▹▹",
14                "▹▹▸▹▹",
15                "▹▹▹▸▹",
16                "▹▹▹▹▸",
17                "▪▪▪▪▪",
18            ]),
19    );
20    pb.set_message(message.to_string());
21    pb
22}