instead of the ugly lazy_static { pub static ref .. }
blocks, having a single line as such looks way better:
const MY_T: Mutex<Option<T>> = parking_lot::const_mutex(None);
fn access_later(t: T) {
MY_T.lock().replace(t);
}
This compiles, and there is no exposed unsafe code. What do you guys think about this approach? Is this even valid?