Skip to content

Commit

Permalink
Clarify module hierarchy
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Apr 12, 2022
1 parent 7ff77d0 commit c0e806e
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 10 deletions.
9 changes: 6 additions & 3 deletions src/offset/local.rs → src/offset/local/mod.rs
Expand Up @@ -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
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -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> {
Expand Down
Expand Up @@ -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> {
Expand Down
2 changes: 1 addition & 1 deletion src/offset/sys/unix.rs → src/offset/local/unix.rs
Expand Up @@ -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<Local> {
Expand Down
File renamed without changes.
3 changes: 0 additions & 3 deletions src/offset/mod.rs
Expand Up @@ -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;

Expand Down

0 comments on commit c0e806e

Please sign in to comment.