Skip to content

Commit fd12ae1

Browse files
committed
subscriber: fix LocalTime being re-exported by the time feature (#1685)
## Motivation Currently, the `pub use` re-export for the `LocalTime` struct is enabled whenever the "time" feature flag is enabled. However, this type only _exists_ when the "local-time" feature flag is enabled, so enabling only the `time` feature results in a compilation error. ## Solution This commit adds a separate `pub use` for `LocalTime` that's only enabled when the "local-time" feature is enabled. Fixes #1683
1 parent e65c78b commit fd12ae1

File tree

1 file changed

+5
-2
lines changed
  • tracing-subscriber/src/fmt/time

1 file changed

+5
-2
lines changed

Diff for: tracing-subscriber/src/fmt/time/mod.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@ use std::time::Instant;
66
mod datetime;
77

88
#[cfg(feature = "time")]
9-
#[cfg_attr(docsrs, doc(cfg(feature = "time")))]
109
mod time_crate;
1110
#[cfg(feature = "time")]
1211
#[cfg_attr(docsrs, doc(cfg(feature = "time")))]
13-
pub use time_crate::{LocalTime, UtcTime};
12+
pub use time_crate::UtcTime;
13+
14+
#[cfg(feature = "local-time")]
15+
#[cfg_attr(docsrs, doc(cfg(feature = "local-time")))]
16+
pub use time_crate::LocalTime;
1417

1518
/// A type that can measure and format the current time.
1619
///

0 commit comments

Comments
 (0)