diff --git a/rust-app/src/settings.rs b/rust-app/src/settings.rs index 7bc407f..bce02c0 100644 --- a/rust-app/src/settings.rs +++ b/rust-app/src/settings.rs @@ -21,24 +21,19 @@ impl Default for Settings { impl Settings { #[inline(never)] pub fn get_mut(&mut self) -> &mut AtomicStorage<[u8; SETTINGS_SIZE]> { - #[allow(static_mut_refs)] - unsafe { - SETTINGS.get_mut() - } + unsafe { (*(&raw mut SETTINGS)).get_mut() } } #[inline(never)] pub fn get_blind_sign(&self) -> bool { - #[allow(static_mut_refs)] - let settings = unsafe { SETTINGS.get_ref() }; + let settings = unsafe { (*(&raw mut SETTINGS)).get_ref() }; settings.get_ref()[BLINDSIGN_IX] == 1 } // The inline(never) is important. Otherwise weird segmentation faults happen on speculos. #[inline(never)] pub fn set_blind_sign(&mut self, enabled: bool) { - #[allow(static_mut_refs)] - let settings = unsafe { SETTINGS.get_mut() }; + let settings = unsafe { (*(&raw mut SETTINGS)).get_mut() }; let mut switch_values: [u8; SETTINGS_SIZE] = *settings.get_ref(); if enabled { switch_values[BLINDSIGN_IX] = 1;