From 166c469d1c5a14a60b1f144cd40fae08e914678f Mon Sep 17 00:00:00 2001 From: Yoshua Wuyts Date: Wed, 3 Jun 2020 12:09:33 +0200 Subject: [PATCH 1/2] Add the tokio02 feature flag --- Cargo.toml | 3 ++- src/lib.rs | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index d02577e..d51165b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -51,6 +51,7 @@ alloc = [ "futures-core/alloc", "pin-project-lite", ] +tokio02 = ["smol/tokio02"] [dependencies] async-attributes = { version = "1.1.1", optional = true } @@ -98,4 +99,4 @@ required-features = ["unstable"] [[example]] name = "surf-web" -required-features = ["surf"] \ No newline at end of file +required-features = ["surf"] diff --git a/src/lib.rs b/src/lib.rs index 2dbd258..e5b0438 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -214,6 +214,15 @@ //! features = ["attributes"] //! ``` //! +//! Compatibility with the `tokio` runtime is possible using the `tokio02` +//! Cargo feature: +//! +//! ```toml +//! [dependencies.async-std] +//! version = "1.6.0" +//! features = ["tokio02"] +//! ``` +//! //! Additionally it's possible to only use the core traits and combinators by //! only enabling the `std` Cargo feature: //! From 0df3c02b81f8b581dab0104fb13fdd662caa046f Mon Sep 17 00:00:00 2001 From: Yoshua Wuyts Date: Wed, 3 Jun 2020 12:40:02 +0200 Subject: [PATCH 2/2] check tokio02 features --- .github/workflows/ci.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1a0c432..fcbc4bd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -110,6 +110,17 @@ jobs: command: check args: --no-default-features --features alloc --target thumbv7m-none-eabi -Z avoid-dev-deps + check_tokio_02_feature: + name: Check tokio02 feature + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: check tokio02 + uses: actions-rs/cargo@v1 + with: + command: check + args: --all --features tokio02 + cross: name: Cross compile runs-on: ubuntu-latest