diff --git a/examples/download.rs b/examples/download.rs index beb629ce..994696c5 100644 --- a/examples/download.rs +++ b/examples/download.rs @@ -10,7 +10,8 @@ fn main() { let pb = ProgressBar::new(total_size); pb.set_style(ProgressStyle::default_bar() - .template("{spinner:.green} [{elapsed_precise}] [{wide_bar:.cyan/blue}] {bytes}/{total_bytes} ({eta})") + .with_key("eta_secs", |state| format!("{:.1}s", state.eta().as_secs_f64())) + .template("{spinner:.green} [{elapsed_precise}] [{wide_bar:.cyan/blue}] {bytes}/{total_bytes} ({eta_secs} remaining)") .progress_chars("#>-")); while downloaded < total_size {