console-rs / indicatif

A command line progress reporting library for Rust
MIT License
4.23k stars 240 forks source link

Only tick if the ticker is disabled #458

Closed djc closed 1 year ago

djc commented 1 year ago

Fix a regression from #417 to fix #457.

Of the 4 callers of BarState::tick(), changed three to no longer tick if the ticker is enabled:

The fourth is ProgressBar::tick(), which already only ticked if the ticker was disabled.

djc commented 1 year ago

Seems like the performance impact here is negligible (based on running cargo run --release --example fastbar), although it's a little ugly that we have to lock another mutex.