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

fix: inc after work #522

Merged
merged 1 commit into from May 23, 2023
Merged

fix: inc after work #522

merged 1 commit into from May 23, 2023

Conversation

tatref
Copy link
Contributor

@tatref tatref commented Feb 26, 2023

See #521

Copy link
Collaborator

@djc djc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this makes sense. I hesitate to spend much more time on this, but I do wonder if some of these set_message() calls belong before the sleep()/work?

@tatref
Copy link
Contributor Author

tatref commented Feb 26, 2023

I guess the effect of set_message is only seen after calling inc? So this should probably be just after inc?

I missed it in the finebars example:

thread::sleep(wait);
pb.inc(1);
pb.set_message(format!("{:3}%", 100 * i / 512));

@djc
Copy link
Collaborator

djc commented May 23, 2023

I guess the effect of set_message is only seen after calling inc? So this should probably be just after inc?

Hmm, I suppose both set_message() and inc() will end up calling ProgressState::update_estimate_and_draw() so it probably doesn't really matter which one goes first.

@djc djc merged commit e0494e4 into console-rs:main May 23, 2023
@djc djc mentioned this pull request May 24, 2023
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.

None yet

2 participants