util: anotate time module as requiring time feature (#3606)

Signed-off-by: Zahari Dichev <[email protected]>
This commit is contained in:
Zahari Dichev
2021-03-11 16:02:01 +01:00
committed by GitHub
parent 1cda0f16a2
commit edfff7551a
2 changed files with 14 additions and 3 deletions
+10
View File
@@ -47,3 +47,13 @@ macro_rules! cfg_rt {
)*
}
}
macro_rules! cfg_time {
($($item:item)*) => {
$(
#[cfg(feature = "time")]
#[cfg_attr(docsrs, doc(cfg(feature = "time")))]
$item
)*
}
}
+4 -3
View File
@@ -45,13 +45,14 @@ cfg_rt! {
pub mod context;
}
cfg_time! {
pub mod time;
}
pub mod sync;
pub mod either;
#[cfg(feature = "time")]
pub mod time;
#[cfg(any(feature = "io", feature = "codec"))]
mod util {
use tokio::io::{AsyncRead, AsyncWrite, ReadBuf};