Skip to content

Commit dcd7c55

Browse files
committed
Put everything behind a 'stable' feature
1 parent 87de4e1 commit dcd7c55

File tree

3 files changed

+40
-27
lines changed

3 files changed

+40
-27
lines changed

Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ features = ["docs"]
2121
rustdoc-args = ["--cfg", "feature=\"docs\""]
2222

2323
[features]
24+
default = ["stable"]
2425
docs = ["unstable"]
2526
unstable = ["broadcaster"]
27+
stable = []
2628

2729
[dependencies]
2830
async-macros = "1.0.0"

src/lib.rs

+38-25
Original file line numberDiff line numberDiff line change
@@ -49,33 +49,46 @@
4949
#![doc(html_logo_url = "https://async.rs/images/logo--hero.svg")]
5050
#![recursion_limit = "2048"]
5151

52-
#[macro_use]
53-
mod utils;
52+
/// Declares stable items.
53+
#[doc(hidden)]
54+
macro_rules! cfg_stable {
55+
($($item:item)*) => {
56+
$(
57+
#[cfg(feature = "stable")]
58+
$item
59+
)*
60+
}
61+
}
5462

55-
pub mod fs;
56-
pub mod future;
57-
pub mod io;
58-
pub mod net;
59-
pub mod os;
60-
pub mod path;
61-
pub mod prelude;
62-
pub mod stream;
63-
pub mod sync;
64-
pub mod task;
63+
cfg_stable! {
64+
#[macro_use]
65+
mod utils;
6566

66-
cfg_unstable! {
67-
pub mod pin;
68-
pub mod process;
67+
pub mod fs;
68+
pub mod future;
69+
pub mod io;
70+
pub mod net;
71+
pub mod os;
72+
pub mod path;
73+
pub mod prelude;
74+
pub mod stream;
75+
pub mod sync;
76+
pub mod task;
6977

70-
mod unit;
71-
mod vec;
72-
mod result;
73-
mod option;
74-
mod string;
75-
mod collections;
78+
cfg_unstable! {
79+
pub mod pin;
80+
pub mod process;
7681

77-
#[doc(inline)]
78-
pub use std::{write, writeln};
79-
}
82+
mod unit;
83+
mod vec;
84+
mod result;
85+
mod option;
86+
mod string;
87+
mod collections;
8088

81-
mod macros;
89+
#[doc(inline)]
90+
pub use std::{write, writeln};
91+
}
92+
93+
mod macros;
94+
}

src/prelude.rs

-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ pub use crate::io::Seek as _;
2323
pub use crate::io::Write as _;
2424
#[doc(no_inline)]
2525
pub use crate::stream::Stream;
26-
#[doc(no_inline)]
27-
pub use crate::task_local;
2826

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

0 commit comments

Comments
 (0)