Add RawCell::unsafe_set

This commit is contained in:
Jeremy Soller
2025-10-04 07:50:16 -06:00
parent 82084440ad
commit ced734c162
8 changed files with 41 additions and 36 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ pub fn init_state() -> &'static State {
// Safe due to STATE being thread_local (TODO: is it though?)
unsafe {
if STATE.unsafe_ref().is_none() {
*STATE.as_mut_ptr() = Some(State::new())
STATE.unsafe_set(Some(State::new()));
}
let state_ptr = STATE.unsafe_ref().as_ref().unwrap() as *const State;
&*state_ptr