Skip to content

fix: inc after work#522

Merged
djc merged 1 commit intoconsole-rs:mainfrom
tatref:fix-inc-placement
May 23, 2023
Merged

fix: inc after work#522
djc merged 1 commit intoconsole-rs:mainfrom
tatref:fix-inc-placement

Conversation

@tatref
Copy link
Copy Markdown
Contributor

@tatref tatref commented Feb 26, 2023

See #521

Copy link
Copy Markdown
Member

@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
Copy Markdown
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
Copy Markdown
Member

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.

2 participants