Updates for indicatif 0.17

This commit is contained in:
David Peter 2022-08-03 13:00:00 +02:00 committed by David Peter
parent e2d702eed5
commit 71c139c81e

View File

@ -1,4 +1,5 @@
use indicatif::{ProgressBar, ProgressStyle};
use std::time::Duration;
use crate::options::OutputStyleOption;
@ -14,7 +15,8 @@ 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 {
@ -22,7 +24,7 @@ pub fn get_progress_bar(length: u64, msg: &str, option: OutputStyleOption) -> Pr
_ => 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