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.
Once::new
ONCE_INIT
1 parent 3482c31 commit c668142Copy full SHA for c668142
1 file changed
src/lib.rs
@@ -144,8 +144,8 @@ pub fn hook(info: &panic::PanicInfo) {
144
/// invocations do nothing.
145
#[inline]
146
pub fn set_once() {
147
- use std::sync::{ONCE_INIT, Once};
148
- static SET_HOOK: Once = ONCE_INIT;
+ use std::sync::Once;
+ static SET_HOOK: Once = Once::new();
149
SET_HOOK.call_once(|| {
150
panic::set_hook(Box::new(hook));
151
});
0 commit comments