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 ProgressState::duration() overflow #560

Merged
merged 1 commit into from Jul 27, 2023
Merged

Conversation

alexheretic
Copy link
Contributor

@alexheretic alexheretic commented Jul 12, 2023

In scenarios where the ProgressState::eta() returns very high/maxed Duration, calling ProgressState::duration() can panic as elapsed + eta overflows.

This PR avoids that panic. In this scenario ProgressState::duration() will return Duration::MAX.

Fixes #561

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.

Thanks!

@djc djc merged commit 257e79f into console-rs:main Jul 27, 2023
9 checks passed
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.

Panic related to high eta
2 participants