2 ms·
Rust has https://lib.rs/once_cell https://lib.rs/once_cell for this. It's a wrapper type that ensures something can be written to only once, atomically, and aft
by pornel 6y ago
Rust has https://lib.rs/once_cell https://lib.rs/once_cell for this. It's a wrapper type that ensures something can be written to only once, atomically, and after that it's immutable, so it can be shared freely.
It's not a program-wide stage, but it's sufficient to use it in `main()` to make it behave like that.