diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-10-10 21:59:10 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-10-10 22:09:49 -0700 |
| commit | dae48a07f34dcf714b3b57029f4e03a0b95a269e (patch) | |
| tree | 4ced3fe4c6c167508f0f7d1308473dfec676846d /src/liblog | |
| parent | 1add4dedc131d5f98d82feafe80d92ed1f3f6d49 (diff) | |
| download | rust-dae48a07f34dcf714b3b57029f4e03a0b95a269e.tar.gz rust-dae48a07f34dcf714b3b57029f4e03a0b95a269e.zip | |
Register new snapshots
Also convert a number of `static mut` to just a plain old `static` and remove some unsafe blocks.
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 |
