diff options
Diffstat (limited to 'src/liblog')
| -rw-r--r-- | src/liblog/lib.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/liblog/lib.rs b/src/liblog/lib.rs index b08ad3b6c61..9d5080522c2 100644 --- a/src/liblog/lib.rs +++ b/src/liblog/lib.rs @@ -348,8 +348,8 @@ pub struct LogLocation { /// module's log statement should be emitted or not. #[doc(hidden)] pub fn mod_enabled(level: u32, module: &str) -> bool { - static mut INIT: Once = ONCE_INIT; - unsafe { INIT.doit(init); } + static INIT: Once = ONCE_INIT; + INIT.doit(init); // It's possible for many threads are in this function, only one of them // will perform the global initialization, but all of them will need to check |
