mirror of
https://github.com/sharkdp/hyperfine.git
synced 2024-09-11 14:07:02 +03:00
Updates for indicatif 0.17
This commit is contained in:
parent
e2d702eed5
commit
71c139c81e
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user