Skip to content

Commit

Permalink
Updates for indicatif 0.17
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkdp authored and David Peter committed Aug 3, 2022
1 parent 6b9c4ca commit 51ac04b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/output/progress_bar.rs
@@ -1,4 +1,5 @@
use indicatif::{ProgressBar, ProgressStyle};
use std::time::Duration;

use crate::options::OutputStyleOption;

Expand All @@ -14,15 +15,16 @@ pub fn get_progress_bar(length: u64, msg: &str, option: OutputStyleOption) -> Pr
OutputStyleOption::Basic | OutputStyleOption::Color => ProgressStyle::default_bar(),
_ => ProgressStyle::default_spinner()
.tick_chars(TICK_SETTINGS.0)
.template(" {spinner} {msg:<30} {wide_bar} ETA {eta_precise}"),
.template(" {spinner} {msg:<30} {wide_bar} ETA {eta_precise}")
.expect("no template error"),
};

let progress_bar = match option {
OutputStyleOption::Basic | OutputStyleOption::Color => ProgressBar::hidden(),
_ => ProgressBar::new(length),
};
progress_bar.set_style(progressbar_style);
progress_bar.enable_steady_tick(TICK_SETTINGS.1);
progress_bar.enable_steady_tick(Duration::from_millis(TICK_SETTINGS.1));
progress_bar.set_message(msg.to_owned());

progress_bar
Expand Down

0 comments on commit 51ac04b

Please sign in to comment.