We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
UnsafeCell
1 parent 6308bb2 commit 20bf587Copy full SHA for 20bf587
ctru-rs/src/applets/error.rs
@@ -107,7 +107,9 @@ impl PanicHookConfig {
107
}
108
109
110
- unsafe fn get(&self) -> *mut errorConf {
+ // There can only be one invocation of an applet active at any given time, so our `UnsafeCell`
111
+ // crimes *should* be okay here.
112
+ unsafe fn get(&self) -> &mut errorConf {
113
unsafe { (*self.error_app.get()).state.as_mut() }
114
115
@@ -130,7 +132,7 @@ pub(crate) fn set_panic_hook(call_old_hook: bool) {
130
132
old_hook(panic_info);
131
133
134
- let error_conf = unsafe { &mut *config.get() };
135
+ let error_conf = unsafe { config.get() };
136
137
let mut buf1 = itoa::Buffer::new();
138
0 commit comments