From 586a7e58b87d0f7418c798059c2e08e2e4bda26a Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 6 May 2019 15:30:58 +0200 Subject: [PATCH] chore: Update parking_lot to 0.8 Signed-off-by: Igor Gnatenko --- src/imp_pl.rs | 6 +++--- src/lib.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/imp_pl.rs b/src/imp_pl.rs index 8dbd853..c14ac4d 100644 --- a/src/imp_pl.rs +++ b/src/imp_pl.rs @@ -1,7 +1,7 @@ extern crate parking_lot; use std::cell::UnsafeCell; -use self::parking_lot::{Once, ONCE_INIT, OnceState}; +use self::parking_lot::{Once, OnceState}; /// A thread-safe cell which can be written to only once. /// @@ -55,14 +55,14 @@ impl PartialEq for OnceCell { impl OnceCell { /// An empty cell, for initialization in a `const` context. pub const INIT: OnceCell = OnceCell { - once: ONCE_INIT, + once: Once::new(), value: UnsafeCell::new(None), }; /// Creates a new empty cell. pub fn new() -> OnceCell { OnceCell { - once: ONCE_INIT, + once: Once::new(), value: UnsafeCell::new(None), } } diff --git a/src/lib.rs b/src/lib.rs index 3aef107..a5625aa 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -160,7 +160,7 @@ unifies the APIs of those crates. To implement a sync flavor of `OnceCell`, this crates uses either `::std::sync::Once` or `::parking_lot::Once`. This is controlled by the `parking_lot` feature, which is enabled by default. -When using `parking_lot`, the crate is compatible with rustc 1.25.0, without `parking_lot` a minimum +When using `parking_lot`, the crate is compatible with rustc 1.31.0, without `parking_lot` a minimum of `1.29.0` is required. This crate uses unsafe. -- 2.21.0