News for hackers. Stuff that matters.
Re:What Is Rust's Unsafe? (2019) by oconnor663 on Sunday April 10, 2022 @04:41PM (#30981488)
Yeah if you don't need mutation after initialization is done, Arc<T> is a good option for sharing. Lazy<T> (https://docs.rs/once_cell/latest/once_cell/sync/struct.Lazy....) is also nice, especially if you want to keep treating it like a global. I believe something like Lazy<T> is eventually going to be included in the standard library.
Re:What Is Rust's Unsafe? (2019) by jamincan on Sunday April 10, 2022 @07:09PM (#30982681)