Skip to content

Commit

Permalink
fix multi example
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-laplante committed Aug 4, 2022
1 parent fb8b10e commit 6666b48
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion examples/multi.rs
Expand Up @@ -11,14 +11,19 @@ fn main() {
.unwrap()
.progress_chars("##-");

let mut pb_set = vec![];

let pb = m.add(ProgressBar::new(128));
pb.set_style(sty.clone());
pb_set.push(pb.clone());

let pb2 = m.insert_after(&pb, ProgressBar::new(128));
pb2.set_style(sty.clone());
pb_set.push(pb2.clone());

let pb3 = m.insert_after(&pb2, ProgressBar::new(1024));
pb3.set_style(sty);
pb_set.push(pb3.clone());

m.println("starting!").unwrap();

Expand Down Expand Up @@ -60,5 +65,8 @@ fn main() {

let _ = h1.join();
let _ = h2.join();
m.clear().unwrap();

for pb in pb_set.drain(..) {
pb.finish_and_clear();
}
}

0 comments on commit 6666b48

Please sign in to comment.