Skip to content

Commit

Permalink
util: anotate time module as requiring time feature (#3606)
Browse files Browse the repository at this point in the history
Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
  • Loading branch information
zaharidichev authored Mar 11, 2021
1 parent 1cda0f1 commit edfff75
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
10 changes: 10 additions & 0 deletions tokio-util/src/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
)*
}
}
7 changes: 4 additions & 3 deletions tokio-util/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down

0 comments on commit edfff75

Please sign in to comment.