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

Add builder-like with_finish method to ProgressBarIter. #548

Merged
merged 3 commits into from Jun 3, 2023

Conversation

matthewhchan
Copy link
Contributor

@matthewhchan matthewhchan commented Jun 2, 2023

This lets you more concisely set the finish behavior of the progress bar when using ProgressBarIter.

For example, to show a progress bar and keep it displayed when it finishes, you can do

v.iter().progress().with_finish(ProgressFinish::AndLeave)

instead of

v.iter()
        .progress_with(ProgressBar::new(v.len() as u64).with_finish(ProgressFinish::AndLeave));

Closes #545

@matthewhchan matthewhchan requested a review from djc June 3, 2023 18:40
@djc djc merged commit bd320a1 into console-rs:main Jun 3, 2023
9 checks passed
@djc
Copy link
Collaborator

djc commented Jun 3, 2023

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Add builder-like with_finish method to ProgressBarIter to set finish behavior
2 participants