Skip to content

Commit

Permalink
replace ATOMIC_BOOL_INIT with ::new()
Browse files Browse the repository at this point in the history
  • Loading branch information
barzamin committed Feb 6, 2019
1 parent 5284834 commit b8fdaa6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/once/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ macro_rules! assert_first_call {
};

($($arg:tt)+) => {{
use ::core::sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT, Ordering};
static CALLED: AtomicBool = ATOMIC_BOOL_INIT;
use ::core::sync::atomic::{AtomicBool, Ordering};
static CALLED: AtomicBool = AtomicBool::new(false);
let called = CALLED.swap(true, Ordering::Relaxed);
assert!(!called, $($arg)+);
}};
Expand Down

0 comments on commit b8fdaa6

Please sign in to comment.