Remove usage of ATOMIC_BOOL_INIT

We currently don't support old enough compilers to require this.
This commit is contained in:
Diggory Hardy
2019-02-25 16:44:53 +00:00
parent a40d3ded39
commit 0d5f4c56f2
2 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -15,9 +15,9 @@ use std::fs::File;
use std::io;
use std::io::Read;
use std::cell::RefCell;
use std::sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT, Ordering};
use std::sync::atomic::{AtomicBool, Ordering};
static RNG_INIT: AtomicBool = ATOMIC_BOOL_INIT;
static RNG_INIT: AtomicBool = AtomicBool::new(false);
enum RngSource {
GetRandom,
@@ -67,7 +67,7 @@ fn is_getrandom_available() -> bool {
use std::sync::{Once, ONCE_INIT};
static CHECKER: Once = ONCE_INIT;
static AVAILABLE: AtomicBool = ATOMIC_BOOL_INIT;
static AVAILABLE: AtomicBool = AtomicBool::new(false);
CHECKER.call_once(|| {
let mut buf: [u8; 0] = [];
+2 -2
View File
@@ -13,9 +13,9 @@ use super::utils::use_init;
use std::fs::File;
use std::io::Read;
use std::cell::RefCell;
use std::sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT, Ordering};
use std::sync::atomic::{AtomicBool, Ordering};
static RNG_INIT: AtomicBool = ATOMIC_BOOL_INIT;
static RNG_INIT: AtomicBool = AtomicBool::new(false);
thread_local!(static RNG_FILE: RefCell<Option<File>> = RefCell::new(None));