Skip to content

Commit

Permalink
Merge pull request #48 from asomers/more-ci2
Browse files Browse the repository at this point in the history
Misc development improvements
  • Loading branch information
asomers authored Nov 19, 2021
2 parents 7c9addc + 813ff5b commit 27b60a8
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
test_task:
name: cargo test
env:
RUSTDOCFLAGS: -D warnings
matrix:
- container:
image: rust:1.45.0
Expand Down
7 changes: 3 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "futures-locks"
edition = "2018"
version = "0.6.1-pre"
version = "0.6.0"
authors = ["Alan Somers <asomers@gmail.com>"]
license = "MIT/Apache-2.0"
readme = "README.md"
Expand All @@ -15,13 +15,12 @@ autotests = false
include = ["src/**/*", "LICENSE-*", "README.md", "CHANGELOG.md"]

[package.metadata.docs.rs]
features = ["tokio", "nightly-docs"]
features = ["tokio"]
rustdoc-args = ["--cfg", "docsrs"]

[features]
# Enable methods that require a Tokio runtime.
default = ["tokio"]
# For building documentation only; no functional change to the library.
nightly-docs = []

[dependencies]
futures-channel = "0.3.1"
Expand Down
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
//! [`Futures`]: https://github.com/rust-lang-nursery/futures-rs
//! [`Tokio`]: https:/tokio.rs

#![cfg_attr(feature = "nightly-docs", feature(doc_cfg))]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![warn(missing_docs)]

mod mutex;
mod rwlock;
Expand Down
8 changes: 4 additions & 4 deletions src/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,8 @@ impl<T: 'static + ?Sized> Mutex<T> {
/// assert_eq!(mtx.try_unwrap().unwrap(), 5);
/// # }
/// ```
#[cfg(any(feature = "tokio", all(feature = "nightly-docs", rustdoc)))]
#[cfg_attr(feature = "nightly-docs", doc(cfg(feature = "tokio")))]
#[cfg(any(feature = "tokio", all(docsrs, rustdoc)))]
#[cfg_attr(docsrs, doc(cfg(feature = "tokio")))]
pub fn with<B, F, R>(&self, f: F)
-> impl Future<Output = R>
where F: FnOnce(MutexGuard<T>) -> B + Send + 'static,
Expand Down Expand Up @@ -403,8 +403,8 @@ impl<T: 'static + ?Sized> Mutex<T> {
/// assert_eq!(*mtx.try_unwrap().unwrap(), 5);
/// # }
/// ```
#[cfg(any(feature = "tokio", all(feature = "nightly-docs", rustdoc)))]
#[cfg_attr(feature = "nightly-docs", doc(cfg(feature = "tokio")))]
#[cfg(any(feature = "tokio", all(docsrs, rustdoc)))]
#[cfg_attr(docsrs, doc(cfg(feature = "tokio")))]
pub fn with_local<B, F, R>(&self, f: F)
-> impl Future<Output = R>
where F: FnOnce(MutexGuard<T>) -> B + 'static,
Expand Down
16 changes: 8 additions & 8 deletions src/rwlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,8 @@ impl<T: 'static + ?Sized> RwLock<T> {
/// assert_eq!(r, 5);
/// # }
/// ```
#[cfg(any(feature = "tokio", all(feature = "nightly-docs", rustdoc)))]
#[cfg_attr(feature = "nightly-docs", doc(cfg(feature = "tokio")))]
#[cfg(any(feature = "tokio", all(docsrs, rustdoc)))]
#[cfg_attr(docsrs, doc(cfg(feature = "tokio")))]
pub fn with_read<B, F, R>(&self, f: F)
-> impl Future<Output = R>
where F: FnOnce(RwLockReadGuard<T>) -> B + Send + 'static,
Expand Down Expand Up @@ -541,8 +541,8 @@ impl<T: 'static + ?Sized> RwLock<T> {
/// assert_eq!(r, 5);
/// # }
/// ```
#[cfg(any(feature = "tokio", all(feature = "nightly-docs", rustdoc)))]
#[cfg_attr(feature = "nightly-docs", doc(cfg(feature = "tokio")))]
#[cfg(any(feature = "tokio", all(docsrs, rustdoc)))]
#[cfg_attr(docsrs, doc(cfg(feature = "tokio")))]
pub fn with_read_local<B, F, R>(&self, f: F)
-> impl Future<Output = R>
where F: FnOnce(RwLockReadGuard<T>) -> B + 'static + Unpin,
Expand Down Expand Up @@ -591,8 +591,8 @@ impl<T: 'static + ?Sized> RwLock<T> {
/// assert_eq!(rwlock.try_unwrap().unwrap(), 5);
/// # }
/// ```
#[cfg(any(feature = "tokio", all(feature = "nightly-docs", rustdoc)))]
#[cfg_attr(feature = "nightly-docs", doc(cfg(feature = "tokio")))]
#[cfg(any(feature = "tokio", all(docsrs, rustdoc)))]
#[cfg_attr(docsrs, doc(cfg(feature = "tokio")))]
pub fn with_write<B, F, R>(&self, f: F)
-> impl Future<Output = R>
where F: FnOnce(RwLockWriteGuard<T>) -> B + Send + 'static,
Expand Down Expand Up @@ -632,8 +632,8 @@ impl<T: 'static + ?Sized> RwLock<T> {
/// assert_eq!(*rwlock.try_unwrap().unwrap(), 5);
/// # }
/// ```
#[cfg(any(feature = "tokio", all(feature = "nightly-docs", rustdoc)))]
#[cfg_attr(feature = "nightly-docs", doc(cfg(feature = "tokio")))]
#[cfg(any(feature = "tokio", all(docsrs, rustdoc)))]
#[cfg_attr(docsrs, doc(cfg(feature = "tokio")))]
pub fn with_write_local<B, F, R>(&self, f: F)
-> impl Future<Output = R>
where F: FnOnce(RwLockWriteGuard<T>) -> B + 'static + Unpin,
Expand Down

0 comments on commit 27b60a8

Please sign in to comment.