Skip to content

Commit

Permalink
wip: fix spinner steps
Browse files Browse the repository at this point in the history
  • Loading branch information
markxoe committed Jun 8, 2024
1 parent 4af98c0 commit 67b65ee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/indication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::time::Duration;

use indicatif::{ProgressBar, ProgressStyle};

fn progressbar_template(len: u64) -> ProgressBar {
fn progressbar(len: u64) -> ProgressBar {
let pb = ProgressBar::new(len);
pb.set_style(
ProgressStyle::with_template(
Expand Down Expand Up @@ -44,7 +44,7 @@ impl ProgressReporter {
finish_message: &'static str,
len: u64,
) -> Self {
let progress = progressbar_template(len);
let progress = progressbar(len);
progress.set_prefix(format!("[{}/{}]", step, steps));
progress.set_message(message.clone());

Expand Down Expand Up @@ -196,8 +196,8 @@ impl ProgressBuilder {
let finish_message = self.finish_message;

let steps = self
.steps
.map(|steps| (steps, self.step.expect("only steps given, no step")));
.step
.map(|step| (step, self.steps.expect("only step given, steps missing")));

ProgressReporter::new_spinner(message, finish_message, steps)
}
Expand Down

0 comments on commit 67b65ee

Please sign in to comment.