once_cell
A macroless alternative to lazy_static
.
If you like this, you might also like lazycell
.
If you want slightly sweeter syntax, we have macros too!
static HASHMAP: = sync_lazy! ;
Note that this crate requires at least rustc 1.29 and the beta
Cargo feature to enable full API.
Without it, sync::Lazy
works only in static contexts and requires explicit .deref_static
call
for dereference.