Skip to content

Commit

Permalink
Move naive module contents into a separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Mar 22, 2022
1 parent b72d747 commit 36a6e0d
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 39 deletions.
41 changes: 2 additions & 39 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -552,48 +552,11 @@ macro_rules! try_opt {
};
}

pub mod offset;
pub mod naive {
//! Date and time types unconcerned with timezones.
//!
//! They are primarily building blocks for other types
//! (e.g. [`TimeZone`](../offset/trait.TimeZone.html)),
//! but can be also used for the simpler date and time handling.
mod date;
mod datetime;
mod internals;
mod isoweek;
mod time;

pub use self::date::{NaiveDate, MAX_DATE, MIN_DATE};
#[cfg(feature = "rustc-serialize")]
#[allow(deprecated)]
pub use self::datetime::rustc_serialize::TsSeconds;
pub use self::datetime::{NaiveDateTime, MAX_DATETIME, MIN_DATETIME};
pub use self::isoweek::IsoWeek;
pub use self::time::NaiveTime;

#[cfg(feature = "__internal_bench")]
#[doc(hidden)]
pub use self::internals::YearFlags as __BenchYearFlags;

/// Serialization/Deserialization of naive types in alternate formats
///
/// The various modules in here are intended to be used with serde's [`with`
/// annotation][1] to serialize as something other than the default [RFC
/// 3339][2] format.
///
/// [1]: https://serde.rs/attributes.html#field-attributes
/// [2]: https://tools.ietf.org/html/rfc3339
#[cfg(feature = "serde")]
pub mod serde {
pub use super::datetime::serde::*;
}
}
mod date;
mod datetime;
pub mod format;
pub mod naive;
pub mod offset;
mod round;

#[cfg(feature = "__internal_bench")]
Expand Down
36 changes: 36 additions & 0 deletions src/naive/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//! Date and time types unconcerned with timezones.
//!
//! They are primarily building blocks for other types
//! (e.g. [`TimeZone`](../offset/trait.TimeZone.html)),
//! but can be also used for the simpler date and time handling.
mod date;
mod datetime;
mod internals;
mod isoweek;
mod time;

pub use self::date::{NaiveDate, MAX_DATE, MIN_DATE};
#[cfg(feature = "rustc-serialize")]
#[allow(deprecated)]
pub use self::datetime::rustc_serialize::TsSeconds;
pub use self::datetime::{NaiveDateTime, MAX_DATETIME, MIN_DATETIME};
pub use self::isoweek::IsoWeek;
pub use self::time::NaiveTime;

#[cfg(feature = "__internal_bench")]
#[doc(hidden)]
pub use self::internals::YearFlags as __BenchYearFlags;

/// Serialization/Deserialization of naive types in alternate formats
///
/// The various modules in here are intended to be used with serde's [`with`
/// annotation][1] to serialize as something other than the default [RFC
/// 3339][2] format.
///
/// [1]: https://serde.rs/attributes.html#field-attributes
/// [2]: https://tools.ietf.org/html/rfc3339
#[cfg(feature = "serde")]
pub mod serde {
pub use super::datetime::serde::*;
}

0 comments on commit 36a6e0d

Please sign in to comment.