rust-lang-nursery / lazy-static.rs

A small macro for defining lazy evaluated static variables in Rust.
Apache License 2.0
1.9k stars 111 forks source link

Demo mutable singleton #128

Closed mcandre closed 3 years ago

mcandre commented 5 years ago

Would be nice to show an example of a mutable hashmap singleton in action using std::sync::Mutex.

KodrAus commented 5 years ago

PRs contributing to a suite of cargo examples with some motivating examples of what you might want to use lazy_static for would be much appreciated :+1:

Ben-PH commented 4 years ago

Noticed there's an example in the readme but not as a cargo example.

If good how it is now, just close? Otherwise, we can add the first cargo example for this crate. If so, remove from the readme?