colored-rs / colored

(Rust) Coloring terminal so simple you already know how to do it !
Mozilla Public License 2.0
1.74k stars 84 forks source link

replace lazy_static with OnceLock #164

Closed xTachyon closed 10 months ago

xTachyon commented 10 months ago

Solves #163

This is technically a breaking change because SHOULD_COLORIZE used to be public a static var, and now it's a function.

If this is not acceptable, the other variant would be to use the once_cell crate which provides Lazy which is more similar to how lazy_static was working. This API is unstable in std at the moment.