From c30dfbf2c7774ff223ade553c4ff22f3cfc26a04 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Mon, 21 Mar 2022 20:36:32 -0700 Subject: [PATCH] Move naive module contents into a separate file --- src/lib.rs | 41 ++--------------------------------------- src/naive/mod.rs | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 39 deletions(-) create mode 100644 src/naive/mod.rs diff --git a/src/lib.rs b/src/lib.rs index 78e566257b..8eb11fa7f6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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")] diff --git a/src/naive/mod.rs b/src/naive/mod.rs new file mode 100644 index 0000000000..7a951d0c60 --- /dev/null +++ b/src/naive/mod.rs @@ -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::*; +}