Skip to content

Commit

Permalink
Create progress bar using with_template to avoid double-parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
eblocha committed Aug 19, 2023
1 parent a7fe780 commit 9ae6a36
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/progress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ fn make_progress_bar(size: u64) -> ProgressBar {
let bar = ProgressBar::new(size);

bar.set_style(
ProgressStyle::default_bar()
.template("[{elapsed_precise}] [{bar:40}] {bytes}/{total_bytes} ({bytes_per_sec}, {eta})")
.unwrap()
.progress_chars("#>-")
ProgressStyle::with_template(
"[{elapsed_precise}] [{bar:40}] {bytes}/{total_bytes} ({bytes_per_sec}, {eta})",
)
.unwrap()
.progress_chars("#>-"),
);

bar
Expand Down

0 comments on commit 9ae6a36

Please sign in to comment.