mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-11-01 08:50:19 +00:00
Updates for indicatif 0.17
This commit is contained in:
1 parent
e2d702eed5
commit
71c139c81e
1 file changed
+4
-2
@@ -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
|
||||
|
||||
Reference in new issue
Block a user