diff options
| author | Eduard Burtescu <edy.burt@gmail.com> | 2015-05-27 11:18:36 +0300 |
|---|---|---|
| committer | Eduard Burtescu <edy.burt@gmail.com> | 2015-05-27 11:19:03 +0300 |
| commit | 377b0900aede976b2d37a499bbd7b62c2e39b358 (patch) | |
| tree | b4a5a4431d36ed1a4e0a39c7d2ef2563ecac9bf4 /src/libstd/rand | |
| parent | 6e8e4f847c2ea02fec021ea15dfb2de6beac797a (diff) | |
| download | rust-377b0900aede976b2d37a499bbd7b62c2e39b358.tar.gz rust-377b0900aede976b2d37a499bbd7b62c2e39b358.zip | |
Use `const fn` to abstract away the contents of UnsafeCell & friends.
Diffstat (limited to 'src/libstd/rand')
| -rw-r--r-- | src/libstd/rand/os.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstd/rand/os.rs b/src/libstd/rand/os.rs index 885adf19ca1..a2e6915a6a6 100644 --- a/src/libstd/rand/os.rs +++ b/src/libstd/rand/os.rs @@ -96,11 +96,11 @@ mod imp { target_arch = "aarch64", target_arch = "powerpc")))] fn is_getrandom_available() -> bool { - use sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT, Ordering}; - use sync::{Once, ONCE_INIT}; + use sync::atomic::{AtomicBool, Ordering}; + use sync::Once; - static CHECKER: Once = ONCE_INIT; - static AVAILABLE: AtomicBool = ATOMIC_BOOL_INIT; + static CHECKER: Once = Once::new(); + static AVAILABLE: AtomicBool = AtomicBool::new(false); CHECKER.call_once(|| { let mut buf: [u8; 0] = []; |
