diff --git a/src/offset/local.rs b/src/offset/local/mod.rs similarity index 98% rename from src/offset/local.rs rename to src/offset/local/mod.rs index af5d5cc37e..2f34a67f35 100644 --- a/src/offset/local.rs +++ b/src/offset/local/mod.rs @@ -12,17 +12,20 @@ use crate::naive::{NaiveDate, NaiveDateTime}; use crate::{Date, DateTime}; #[cfg(all(not(unix), not(windows)))] -#[path = "sys/stub.rs"] +#[path = "stub.rs"] mod inner; #[cfg(unix)] -#[path = "sys/unix.rs"] +#[path = "unix.rs"] mod inner; #[cfg(windows)] -#[path = "sys/windows.rs"] +#[path = "windows.rs"] mod inner; +#[cfg(unix)] +mod tz_info; + /// The local timescale. This is implemented via the standard `time` crate. /// /// Using the [`TimeZone`](./trait.TimeZone.html) methods diff --git a/src/offset/sys/stub.rs b/src/offset/local/stub.rs similarity index 100% rename from src/offset/sys/stub.rs rename to src/offset/local/stub.rs diff --git a/src/offset/tz_info/mod.rs b/src/offset/local/tz_info/mod.rs similarity index 100% rename from src/offset/tz_info/mod.rs rename to src/offset/local/tz_info/mod.rs diff --git a/src/offset/tz_info/parser.rs b/src/offset/local/tz_info/parser.rs similarity index 100% rename from src/offset/tz_info/parser.rs rename to src/offset/local/tz_info/parser.rs diff --git a/src/offset/tz_info/rule.rs b/src/offset/local/tz_info/rule.rs similarity index 99% rename from src/offset/tz_info/rule.rs rename to src/offset/local/tz_info/rule.rs index 3e2cf2a3a1..98feb7c3aa 100644 --- a/src/offset/tz_info/rule.rs +++ b/src/offset/local/tz_info/rule.rs @@ -639,10 +639,10 @@ pub(crate) fn is_leap_year(year: i32) -> bool { #[cfg(test)] mod tests { + use super::super::timezone::Transition; + use super::super::{Error, TimeZone}; use super::{AlternateTime, LocalTimeType, RuleDay, TransitionRule}; use crate::matches; - use crate::offset::tz_info::timezone::Transition; - use crate::offset::tz_info::{Error, TimeZone}; #[test] fn test_quoted() -> Result<(), Error> { diff --git a/src/offset/tz_info/timezone.rs b/src/offset/local/tz_info/timezone.rs similarity index 99% rename from src/offset/tz_info/timezone.rs rename to src/offset/local/tz_info/timezone.rs index f61d090e84..3266b05b73 100644 --- a/src/offset/tz_info/timezone.rs +++ b/src/offset/local/tz_info/timezone.rs @@ -533,9 +533,9 @@ const SECONDS_PER_28_DAYS: i64 = SECONDS_PER_DAY * 28; #[cfg(test)] mod tests { + use super::super::Error; use super::{LeapSecond, LocalTimeType, TimeZone, TimeZoneName, Transition, TransitionRule}; use crate::matches; - use crate::offset::tz_info::Error; #[test] fn test_no_dst() -> Result<(), Error> { diff --git a/src/offset/sys/unix.rs b/src/offset/local/unix.rs similarity index 96% rename from src/offset/sys/unix.rs rename to src/offset/local/unix.rs index 0abbbcf62a..769dfd4530 100644 --- a/src/offset/sys/unix.rs +++ b/src/offset/local/unix.rs @@ -10,8 +10,8 @@ use once_cell::sync::Lazy; +use super::tz_info::TimeZone; use super::{DateTime, FixedOffset, Local, NaiveDateTime}; -use crate::offset::tz_info::TimeZone; use crate::Utc; pub(super) fn now() -> DateTime { diff --git a/src/offset/sys/windows.rs b/src/offset/local/windows.rs similarity index 100% rename from src/offset/sys/windows.rs rename to src/offset/local/windows.rs diff --git a/src/offset/mod.rs b/src/offset/mod.rs index 8818676f5a..eb89680ae9 100644 --- a/src/offset/mod.rs +++ b/src/offset/mod.rs @@ -33,9 +33,6 @@ mod local; #[cfg(feature = "clock")] pub use self::local::Local; -#[cfg(all(unix, feature = "clock"))] -mod tz_info; - mod utc; pub use self::utc::Utc;