From cf299f84137dc6622179486fc22467e72b8eeeb4 Mon Sep 17 00:00:00 2001 From: Gerd Zellweger Date: Thu, 7 Feb 2019 17:26:59 -0800 Subject: [PATCH] Fix AtomicUsize deprecation warning. --- src/stack/os/sys.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stack/os/sys.rs b/src/stack/os/sys.rs index 2dae903..c180380 100644 --- a/src/stack/os/sys.rs +++ b/src/stack/os/sys.rs @@ -7,7 +7,7 @@ extern crate std; extern crate libc; -use self::std::sync::atomic::{ATOMIC_USIZE_INIT, AtomicUsize, Ordering}; +use self::std::sync::atomic::{AtomicUsize, Ordering}; use self::std::ptr; use self::std::io::Error as IoError; use self::libc::{c_void, c_int, size_t}; @@ -60,7 +60,7 @@ pub fn page_size() -> usize { } } - static PAGE_SIZE_CACHE: AtomicUsize = ATOMIC_USIZE_INIT; + static PAGE_SIZE_CACHE: AtomicUsize = AtomicUsize::new(0); match PAGE_SIZE_CACHE.load(Ordering::Relaxed) { 0 => { let page_size = sys_page_size();