diff --git a/.github/main.workflow b/.github/main.workflow index 2328a75..4e11cc7 100644 --- a/.github/main.workflow +++ b/.github/main.workflow @@ -1,9 +1,9 @@ -workflow "Main" { +workflow "build" { on = "push" - resolves = ["Test"] + resolves = ["test-nightly"] } -action "Test" { - uses = "docker://rust" - args = "cargo test" +action "test-nightly" { + uses = "docker://rustlang/rust:nightly" + args = "cargo test --features nightly" } diff --git a/Cargo.toml b/Cargo.toml index 6444192..8cc3ff4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,8 +11,11 @@ keywords = ["buffer", "pipe", "channel"] categories = ["asynchronous", "concurrency", "data-structures"] license = "MIT" +[features] +nightly = [] + [dependencies] -futures-preview = "0.3.0-alpha.16" +futures-preview = "0.3.0-alpha.17" [dev-dependencies] criterion = "0.2" diff --git a/benches/pipe.rs b/benches/pipe.rs index 2dffb0e..985bf0a 100644 --- a/benches/pipe.rs +++ b/benches/pipe.rs @@ -1,3 +1,4 @@ +#![cfg(feature = "nightly")] #![feature(async_await)] use criterion::*; diff --git a/src/lib.rs b/src/lib.rs index b0b21c1..760568b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -8,6 +8,6 @@ //! //! See the `pipe` module for details. -#![cfg_attr(test, feature(async_await))] +#![cfg_attr(feature = "nightly", feature(async_await))] pub mod pipe; diff --git a/src/pipe/chunked.rs b/src/pipe/chunked.rs index d248ff5..87785bf 100644 --- a/src/pipe/chunked.rs +++ b/src/pipe/chunked.rs @@ -11,8 +11,7 @@ //! Because of these constraints, instead we use a quite unique type of buffer //! that uses a fixed number of growable buffers that are exchanged back and //! forth between a producer and a consumer. Since each buffer is a vector, it -//! can grow to whatever size is required of it in order to fit a single curl -//! chunk. +//! can grow to whatever size is required of it in order to fit a single chunk. //! //! To avoid the constant allocation overhead of creating a new buffer for every //! chunk, after a consumer finishes reading from a buffer, it returns the @@ -188,7 +187,7 @@ impl AsyncWrite for Writer { } } -#[cfg(test)] +#[cfg(all(test, feature = "nightly"))] mod tests { use futures::executor::block_on; use super::*;