From 073f9fb1f8514f2ab41be629790e29be99e008fb Mon Sep 17 00:00:00 2001 From: Mark Thomas Date: Sun, 28 Apr 2019 23:48:12 +0100 Subject: [PATCH] use AtomicUsize::new(0) instead of ATOMIC_USIZE_INIT Replace ATOMIC_USIZE_INIT with AtomicUsize::new(0) as the constant has been deprecated in favour of calling the constructor. --- src/mux/tab.rs | 2 +- src/mux/window.rs | 2 +- termwiz/src/image.rs | 2 +- termwiz/src/widgets/mod.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mux/tab.rs b/src/mux/tab.rs index 4b6cfdc9c..ade92e101 100644 --- a/src/mux/tab.rs +++ b/src/mux/tab.rs @@ -3,7 +3,7 @@ use failure::Error; use std::cell::RefMut; use term::{KeyCode, KeyModifiers, MouseEvent, TerminalHost}; -static TAB_ID: ::std::sync::atomic::AtomicUsize = ::std::sync::atomic::ATOMIC_USIZE_INIT; +static TAB_ID: ::std::sync::atomic::AtomicUsize = ::std::sync::atomic::AtomicUsize::new(0); pub type TabId = usize; pub fn alloc_tab_id() -> TabId { diff --git a/src/mux/window.rs b/src/mux/window.rs index 7c7e7fe88..af3d7a962 100644 --- a/src/mux/window.rs +++ b/src/mux/window.rs @@ -1,7 +1,7 @@ use crate::mux::{Tab, TabId}; use std::rc::Rc; -static WIN_ID: ::std::sync::atomic::AtomicUsize = ::std::sync::atomic::ATOMIC_USIZE_INIT; +static WIN_ID: ::std::sync::atomic::AtomicUsize = ::std::sync::atomic::AtomicUsize::new(0); pub type WindowId = usize; pub struct Window { diff --git a/termwiz/src/image.rs b/termwiz/src/image.rs index adedf279d..4c9c27dc7 100644 --- a/termwiz/src/image.rs +++ b/termwiz/src/image.rs @@ -88,7 +88,7 @@ impl ImageCell { } } -static IMAGE_ID: ::std::sync::atomic::AtomicUsize = ::std::sync::atomic::ATOMIC_USIZE_INIT; +static IMAGE_ID: ::std::sync::atomic::AtomicUsize = ::std::sync::atomic::AtomicUsize::new(0); #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct ImageData { diff --git a/termwiz/src/widgets/mod.rs b/termwiz/src/widgets/mod.rs index ac045478d..9b54e2bd0 100644 --- a/termwiz/src/widgets/mod.rs +++ b/termwiz/src/widgets/mod.rs @@ -113,7 +113,7 @@ impl ScreenRelativeCoords { } } -static WIDGET_ID: ::std::sync::atomic::AtomicUsize = ::std::sync::atomic::ATOMIC_USIZE_INIT; +static WIDGET_ID: ::std::sync::atomic::AtomicUsize = ::std::sync::atomic::AtomicUsize::new(0); /// The `WidgetId` uniquely describes an instance of a widget. /// Creating a new `WidgetId` generates a new unique identifier which can