(bar: &ProgressBar, color: &str)
| 160 | } |
| 161 | |
| 162 | pub fn set_bar_style(bar: &ProgressBar, color: &str) { |
| 163 | let template = |
| 164 | "{spinner:.%} [{elapsed_precise}] [{wide_bar:.%}] {pos}/{len} frames ({eta_precise})"; |
| 165 | bar.set_style( |
| 166 | ProgressStyle::with_template(&str::replace(template, "%", color).as_str()) |
| 167 | .unwrap() |
| 168 | .with_key("eta", |state: &ProgressState, w: &mut dyn Write| { |
| 169 | write!(w, "{:.1}s", state.eta().as_secs_f64()).unwrap() |
| 170 | }) |
| 171 | .progress_chars("#>-"), |
| 172 | ); |
| 173 | } |
| 174 | |
| 175 | pub fn draw_yellow_bar(total_frames: u64) { |
| 176 | let bar = ProgressBar::new(total_frames); |
no outgoing calls
no test coverage detected