diff --git a/.cirrus.yml b/.cirrus.yml index b230cd5..aeedb60 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -2,7 +2,7 @@ test_task: name: cargo test matrix: - container: - image: rust:1.31.0 + image: rust:1.32.0 - container: image: rust:latest - container: diff --git a/CHANGELOG.md b/CHANGELOG.md index fc5d2b1..0a51726 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Added - Derived `Default` for `Mutex` and `RwLock` ([#22](/~https://github.com/asomers/futures-locks/pull/22)) + +### Changed +- Minimum compiler version has increased to 1.32.0 + ([#28](/~https://github.com/asomers/futures-locks/pull/28)) ## [0.4.0] - 2019-08-24 ### Added diff --git a/Cargo.toml b/Cargo.toml index 300f7ab..dc67a02 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,6 @@ [package] name = "futures-locks" +edition = "2018" version = "0.4.1-pre" authors = ["Alan Somers "] license = "MIT/Apache-2.0" diff --git a/README.md b/README.md index f4388ed..e259631 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ standard library. But instead of blocking until ready, they return Futures which will become ready when the lock is acquired. See the doc comments for individual examples. -`futures-locks` requires Rust 1.31.0 or higher. +`futures-locks` requires Rust 1.32.0 or higher. # License diff --git a/src/lib.rs b/src/lib.rs index ae85836..43d163f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -11,8 +11,6 @@ //! # Examples //! //! ``` -//! # extern crate futures; -//! # extern crate futures_locks; //! # use futures_locks::*; //! # use futures::executor::{Spawn, spawn}; //! # use futures::Future; @@ -29,10 +27,6 @@ #![cfg_attr(feature = "nightly-docs", feature(doc_cfg))] -extern crate futures; -#[cfg(feature = "tokio")] extern crate tokio_current_thread; -#[cfg(feature = "tokio")] extern crate tokio_executor; - mod mutex; mod rwlock; diff --git a/src/mutex.rs b/src/mutex.rs index c32ef4d..91af2ab 100644 --- a/src/mutex.rs +++ b/src/mutex.rs @@ -1,14 +1,15 @@ // vim: tw=80 -use futures::{Async, Future, Poll}; +use futures::{Async, Future, Poll, sync::oneshot}; #[cfg(feature = "tokio")] use futures::future; #[cfg(feature = "tokio")] use futures::future::IntoFuture; -use futures::sync::oneshot; -use std::cell::UnsafeCell; -use std::clone::Clone; -use std::collections::VecDeque; -use std::ops::{Deref, DerefMut}; -use std::sync; +use std::{ + cell::UnsafeCell, + clone::Clone, + collections::VecDeque, + ops::{Deref, DerefMut}, + sync +}; use super::FutState; #[cfg(feature = "tokio")] use tokio_executor::{self, Executor, SpawnError}; #[cfg(feature = "tokio")] use tokio_current_thread as current_thread; @@ -193,8 +194,6 @@ unsafe impl Sync for MutexWeak {} /// # Examples /// /// ``` -/// # extern crate futures; -/// # extern crate futures_locks; /// # use futures_locks::*; /// # use futures::executor::{Spawn, spawn}; /// # use futures::Future; @@ -265,7 +264,6 @@ impl Mutex { /// # Examples /// /// ``` - /// # extern crate futures_locks; /// # use futures_locks::*; /// # fn main() { /// let mut mtx = Mutex::::new(0); @@ -298,7 +296,6 @@ impl Mutex { /// /// # Examples /// ``` - /// # extern crate futures_locks; /// # use futures_locks::*; /// # fn main() { /// let mut mtx = Mutex::::new(0); @@ -353,8 +350,6 @@ impl Mutex { /// # Examples /// /// ``` - /// # extern crate futures; - /// # extern crate futures_locks; /// # extern crate tokio_ as tokio; /// # use futures_locks::*; /// # use futures::{Future, IntoFuture, lazy}; @@ -405,8 +400,6 @@ impl Mutex { /// # Examples /// /// ``` - /// # extern crate futures; - /// # extern crate futures_locks; /// # extern crate tokio_ as tokio; /// # use futures_locks::*; /// # use futures::{Future, IntoFuture, lazy}; diff --git a/src/rwlock.rs b/src/rwlock.rs index 1f7a68e..b335135 100644 --- a/src/rwlock.rs +++ b/src/rwlock.rs @@ -1,14 +1,15 @@ // vim: tw=80 -use futures::{Async, Future, Poll}; +use futures::{Async, Future, Poll, sync::oneshot}; #[cfg(feature = "tokio")] use futures::future; #[cfg(feature = "tokio")] use futures::future::IntoFuture; -use futures::sync::oneshot; -use std::cell::UnsafeCell; -use std::clone::Clone; -use std::collections::VecDeque; -use std::ops::{Deref, DerefMut}; -use std::sync; +use std::{ + cell::UnsafeCell, + clone::Clone, + collections::VecDeque, + ops::{Deref, DerefMut}, + sync, +}; use super::FutState; #[cfg(feature = "tokio")] use tokio_executor::{self, Executor, SpawnError}; #[cfg(feature = "tokio")] use tokio_current_thread as current_thread; @@ -319,7 +320,6 @@ impl RwLock { /// # Examples /// /// ``` - /// # extern crate futures_locks; /// # use futures_locks::*; /// # fn main() { /// let mut lock = RwLock::::new(0); @@ -347,8 +347,6 @@ impl RwLock { /// /// # Examples /// ``` - /// # extern crate futures; - /// # extern crate futures_locks; /// # use futures_locks::*; /// # use futures::executor::{Spawn, spawn}; /// # use futures::Future; @@ -371,8 +369,6 @@ impl RwLock { /// /// # Examples /// ``` - /// # extern crate futures; - /// # extern crate futures_locks; /// # use futures_locks::*; /// # use futures::executor::{Spawn, spawn}; /// # use futures::Future; @@ -395,7 +391,6 @@ impl RwLock { /// /// # Examples /// ``` - /// # extern crate futures_locks; /// # use futures_locks::*; /// # fn main() { /// let mut lock = RwLock::::new(5); @@ -423,7 +418,6 @@ impl RwLock { /// /// # Examples /// ``` - /// # extern crate futures_locks; /// # use futures_locks::*; /// # fn main() { /// let mut lock = RwLock::::new(5); @@ -494,8 +488,6 @@ impl RwLock { /// # Examples /// /// ``` - /// # extern crate futures; - /// # extern crate futures_locks; /// # extern crate tokio_ as tokio; /// # use futures_locks::*; /// # use futures::{Future, IntoFuture, lazy}; @@ -545,8 +537,6 @@ impl RwLock { /// # Examples /// /// ``` - /// # extern crate futures; - /// # extern crate futures_locks; /// # extern crate tokio_ as tokio; /// # use futures_locks::*; /// # use futures::{Future, IntoFuture, lazy}; @@ -605,8 +595,6 @@ impl RwLock { /// # Examples /// /// ``` - /// # extern crate futures; - /// # extern crate futures_locks; /// # extern crate tokio_ as tokio; /// # use futures_locks::*; /// # use futures::{Future, IntoFuture, lazy}; @@ -658,8 +646,6 @@ impl RwLock { /// # Examples /// /// ``` - /// # extern crate futures; - /// # extern crate futures_locks; /// # extern crate tokio_ as tokio; /// # use futures_locks::*; /// # use futures::{Future, IntoFuture, lazy}; diff --git a/tests/test.rs b/tests/test.rs index 7e1f513..76d60f8 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -1,8 +1,6 @@ //vim: tw=80 -extern crate futures; extern crate tokio_ as tokio; -extern crate futures_locks; mod mutex; mod rwlock;