Skip to content

Commit

Permalink
Modify download example to use custom template key
Browse files Browse the repository at this point in the history
  • Loading branch information
redzic authored and djc committed Jul 13, 2021
1 parent 51cc44a commit dbb322f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions examples/download.rs
Expand Up @@ -11,6 +11,7 @@ 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", |state| format!("{:.1}s", state.eta().as_secs_f64()))
.progress_chars("#>-"));

while downloaded < total_size {
Expand Down

0 comments on commit dbb322f

Please sign in to comment.