Skip to content

Commit c668142

Browse files
committed
Use Once::new instead of deprecated ONCE_INIT
1 parent 3482c31 commit c668142

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ pub fn hook(info: &panic::PanicInfo) {
144144
/// invocations do nothing.
145145
#[inline]
146146
pub fn set_once() {
147-
use std::sync::{ONCE_INIT, Once};
148-
static SET_HOOK: Once = ONCE_INIT;
147+
use std::sync::Once;
148+
static SET_HOOK: Once = Once::new();
149149
SET_HOOK.call_once(|| {
150150
panic::set_hook(Box::new(hook));
151151
});

0 commit comments

Comments
 (0)