-
Notifications
You must be signed in to change notification settings - Fork 236
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
Unwrap ProgressFinish #275
Conversation
Thanks for the PR -- can you explain why you think these changes represent an improvement? I like that we no longer need
And also, would you mind going over your other open PRs to see if they are still relevant/useful? |
Preserves the historical behavior
I'm working on #192, probably will update today, and #132 will be obsolete once I finish another PR, no eta on it though. #256 I have currently postponed and will do some refactoring before returning to it.
|
src/style.rs
Outdated
@@ -15,14 +15,14 @@ use unicode_segmentation::UnicodeSegmentation; | |||
pub enum ProgressFinish { | |||
/// Finishes the progress bar and leaves the current message. | |||
/// Same behavior as calling [`ProgressBar::finish()`]. | |||
Default, | |||
Finish, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be clearer if we call this AndLeave
, what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, it's more consistent with the rest, changed it
* Unwrap ProgressFinish * Change ProgressFinish::default to _::AndClear Preserves the historical behavior * Rename `ProgressFinish::Finish` to `_::AndLeave`
This changes default behavior - now a progress bar without an explicitly set on_finish will call
finish
, when previously it would callfinish_and_clear
(src/style.rs:103
). Also,on_finish
won't be reset every timefinish_with_style
is called.