console-rs / indicatif

A command line progress reporting library for Rust
MIT License
4.22k stars 238 forks source link

fix `ProgressState::duration()` overflow #560

Closed alexheretic closed 11 months ago

alexheretic commented 11 months ago

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