matklad / once_cell

Rust library for single assignment cells and lazy statics without macros
Apache License 2.0
1.84k stars 110 forks source link

Clarification on Docs regarding no_std #229

Closed mert-kurttutan closed 1 year ago

mert-kurttutan commented 1 year ago

From FAQ section on docs:

[F.A.Q.](https://docs.rs/once_cell/latest/once_cell/index.html#faq)
Should I use lazy_static or once_cell?

To the first approximation, once_cell is both more flexible and more convenient than lazy_static and should be preferred.

Unlike once_cell, lazy_static supports spinlock-based implementation of blocking which works with #![no_std].

lazy_static has received significantly more real world testing, but once_cell is also a widely used crate.

Maybe, you could also mention critical section based implementation for no_std ??