From 2e66c38453f73e48ee7c1ae1020e2038ed3b0021 Mon Sep 17 00:00:00 2001 From: Paulo Date: Fri, 1 Nov 2019 10:58:51 -0300 Subject: [PATCH] Simplify default feature --- Cargo.toml | 3 +-- src/lib.rs | 64 ++++++++++++++++++++------------------------------ src/prelude.rs | 2 ++ 3 files changed, 29 insertions(+), 40 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index af72b6f..b117b11 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,10 +21,9 @@ features = ["docs"] rustdoc-args = ["--cfg", "feature=\"docs\""] [features] -default = ["stable"] +default = [] docs = ["unstable"] unstable = ["broadcaster"] -stable = [] [dependencies] async-macros = "1.0.0" diff --git a/src/lib.rs b/src/lib.rs index 2685688..ea05edf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -41,6 +41,7 @@ //! features = ["unstable"] //! ``` +#![cfg(feature = "default")] #![cfg_attr(feature = "docs", feature(doc_cfg))] #![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)] #![allow(clippy::mutex_atomic, clippy::module_inception)] @@ -49,46 +50,33 @@ #![doc(html_logo_url = "https://async.rs/images/logo--hero.svg")] #![recursion_limit = "2048"] -/// Declares stable items. -#[doc(hidden)] -macro_rules! cfg_stable { - ($($item:item)*) => { - $( - #[cfg(feature = "stable")] - $item - )* - } -} - -cfg_stable! { - #[macro_use] - mod utils; +#[macro_use] +mod utils; - pub mod fs; - pub mod future; - pub mod io; - pub mod net; - pub mod os; - pub mod path; - pub mod prelude; - pub mod stream; - pub mod sync; - pub mod task; +pub mod fs; +pub mod future; +pub mod io; +pub mod net; +pub mod os; +pub mod path; +pub mod prelude; +pub mod stream; +pub mod sync; +pub mod task; - cfg_unstable! { - pub mod pin; - pub mod process; +cfg_unstable! { + pub mod pin; + pub mod process; - mod unit; - mod vec; - mod result; - mod option; - mod string; - mod collections; + mod unit; + mod vec; + mod result; + mod option; + mod string; + mod collections; - #[doc(inline)] - pub use std::{write, writeln}; - } - - mod macros; + #[doc(inline)] + pub use std::{write, writeln}; } + +mod macros; diff --git a/src/prelude.rs b/src/prelude.rs index 3e235cf..73a5952 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -36,6 +36,8 @@ pub use crate::io::seek::SeekExt as _; pub use crate::io::write::WriteExt as _; #[doc(hidden)] pub use crate::stream::stream::StreamExt as _; +#[doc(hidden)] +pub use crate::task_local; cfg_unstable! { #[doc(no_inline)]