matklad / once_cell

Rust library for single assignment cells and lazy statics without macros

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clarification on Docs regarding no_std

mert-kurttutan opened this issue · comments

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 ??