Skip to content

Put everything behind a 'stable' feature to avoid future breaking changes #434

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 2, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ features = ["docs"]
rustdoc-args = ["--cfg", "feature=\"docs\""]

[features]
default = ["stable"]
docs = ["unstable"]
unstable = ["broadcaster"]
stable = []

[dependencies]
async-macros = "1.0.0"
Expand Down
63 changes: 38 additions & 25 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,33 +49,46 @@
#![doc(html_logo_url = "https://async.rs/images/logo--hero.svg")]
#![recursion_limit = "2048"]

#[macro_use]
mod utils;
/// Declares stable items.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move this macro into utils.rs to group all these macros together?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or, alternatively, I believe you can just put this in lib.rs :)

#![cfg(feature = "stable")]

#[doc(hidden)]
macro_rules! cfg_stable {
($($item:item)*) => {
$(
#[cfg(feature = "stable")]
$item
)*
}
}

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_stable! {
#[macro_use]
mod utils;

cfg_unstable! {
pub mod pin;
pub mod process;
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;

mod unit;
mod vec;
mod result;
mod option;
mod string;
mod collections;
cfg_unstable! {
pub mod pin;
pub mod process;

#[doc(inline)]
pub use std::{write, writeln};
}
mod unit;
mod vec;
mod result;
mod option;
mod string;
mod collections;

mod macros;
#[doc(inline)]
pub use std::{write, writeln};
}

mod macros;
}
2 changes: 0 additions & 2 deletions src/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ pub use crate::io::Seek as _;
pub use crate::io::Write as _;
#[doc(no_inline)]
pub use crate::stream::Stream;
#[doc(no_inline)]
pub use crate::task_local;

#[doc(hidden)]
pub use crate::future::future::FutureExt as _;
Expand Down