Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support increasing the length of the progress bar with a delta. #110

Merged
merged 1 commit into from Sep 7, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/progress.rs
Expand Up @@ -523,6 +523,13 @@ impl ProgressBar {
})
}

/// Increase the length of the progress bar.
pub fn inc_length(&self, delta: u64) {
self.update_and_draw(|state| {
state.len = state.len.saturating_add(delta);
})
}

/// Sets the current prefix of the progress bar.
pub fn set_prefix(&self, prefix: &str) {
let prefix = prefix.to_string();
Expand Down