Skip to content

Commit

Permalink
tidy up imports
Browse files Browse the repository at this point in the history
  • Loading branch information
dovahcrow authored and djc committed Mar 23, 2022
1 parent 0ec64a9 commit c2e9f61
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 23 deletions.
8 changes: 5 additions & 3 deletions src/date.rs
Expand Up @@ -3,23 +3,25 @@

//! ISO 8601 calendar date with time zone.

use crate::oldtime::Duration as OldDuration;
#[cfg(any(feature = "alloc", feature = "std", test))]
use core::borrow::Borrow;
use core::cmp::Ordering;
use core::ops::{Add, Sub};
use core::{fmt, hash};

#[cfg(feature = "rkyv")]
use rkyv::{Archive, Deserialize, Serialize};

#[cfg(feature = "unstable-locales")]
use crate::format::Locale;
#[cfg(any(feature = "alloc", feature = "std", test))]
use crate::format::{DelayedFormat, Item, StrftimeItems};
use crate::naive::{self, IsoWeek, NaiveDate, NaiveTime};
use crate::offset::{TimeZone, Utc};
use crate::oldtime::Duration as OldDuration;
use crate::DateTime;
use crate::{Datelike, Weekday};
#[cfg(feature = "rkyv")]
use rkyv::{Archive, Deserialize, Serialize};

/// ISO 8601 calendar date with time zone.
///
/// You almost certainly want to be using a [`NaiveDate`] instead of this type.
Expand Down
7 changes: 4 additions & 3 deletions src/naive/date.rs
Expand Up @@ -3,22 +3,23 @@

//! ISO 8601 calendar date without timezone.

use crate::oldtime::Duration as OldDuration;
#[cfg(any(feature = "alloc", feature = "std", test))]
use core::borrow::Borrow;
use core::ops::{Add, AddAssign, Sub, SubAssign};
use core::{fmt, str};

use num_integer::div_mod_floor;
use num_traits::ToPrimitive;
#[cfg(feature = "rkyv")]
use rkyv::{Archive, Deserialize, Serialize};

#[cfg(any(feature = "alloc", feature = "std", test))]
use crate::format::DelayedFormat;
use crate::format::{parse, ParseError, ParseResult, Parsed, StrftimeItems};
use crate::format::{Item, Numeric, Pad};
use crate::naive::{IsoWeek, NaiveDateTime, NaiveTime};
use crate::oldtime::Duration as OldDuration;
use crate::{Datelike, Weekday};
#[cfg(feature = "rkyv")]
use rkyv::{Archive, Deserialize, Serialize};

use super::internals::{self, DateImpl, Mdf, Of, YearFlags};
use super::isoweek;
Expand Down
4 changes: 2 additions & 2 deletions src/naive/datetime/mod.rs
Expand Up @@ -10,6 +10,8 @@ use core::{fmt, str};

use num_integer::div_mod_floor;
use num_traits::ToPrimitive;
#[cfg(feature = "rkyv")]
use rkyv::{Archive, Deserialize, Serialize};

#[cfg(any(feature = "alloc", feature = "std", test))]
use crate::format::DelayedFormat;
Expand All @@ -20,8 +22,6 @@ use crate::naive::time::{MAX_TIME, MIN_TIME};
use crate::naive::{IsoWeek, NaiveDate, NaiveTime};
use crate::oldtime::Duration as OldDuration;
use crate::{Datelike, Timelike, Weekday};
#[cfg(feature = "rkyv")]
use rkyv::{Archive, Deserialize, Serialize};

#[cfg(feature = "rustc-serialize")]
pub(super) mod rustc_serialize;
Expand Down
5 changes: 3 additions & 2 deletions src/naive/time/mod.rs
Expand Up @@ -7,16 +7,17 @@
use core::borrow::Borrow;
use core::ops::{Add, AddAssign, Sub, SubAssign};
use core::{fmt, str};

use num_integer::div_mod_floor;
#[cfg(feature = "rkyv")]
use rkyv::{Archive, Deserialize, Serialize};

#[cfg(any(feature = "alloc", feature = "std", test))]
use crate::format::DelayedFormat;
use crate::format::{parse, ParseError, ParseResult, Parsed, StrftimeItems};
use crate::format::{Fixed, Item, Numeric, Pad};
use crate::oldtime::Duration as OldDuration;
use crate::Timelike;
#[cfg(feature = "rkyv")]
use rkyv::{Archive, Deserialize, Serialize};

#[cfg(feature = "rustc-serialize")]
mod rustc_serialize;
Expand Down
5 changes: 3 additions & 2 deletions src/offset/fixed.rs
Expand Up @@ -5,15 +5,16 @@

use core::fmt;
use core::ops::{Add, Sub};

use num_integer::div_mod_floor;
#[cfg(feature = "rkyv")]
use rkyv::{Archive, Deserialize, Serialize};

use super::{LocalResult, Offset, TimeZone};
use crate::naive::{NaiveDate, NaiveDateTime, NaiveTime};
use crate::oldtime::Duration as OldDuration;
use crate::DateTime;
use crate::Timelike;
#[cfg(feature = "rkyv")]
use rkyv::{Archive, Deserialize, Serialize};

/// The time zone with fixed offset, from UTC-23:59:59 to UTC+23:59:59.
///
Expand Down
8 changes: 4 additions & 4 deletions src/offset/local.rs
Expand Up @@ -3,19 +3,19 @@

//! The local (system) time zone.

#[cfg(not(all(target_arch = "wasm32", not(target_os = "wasi"), feature = "wasmbind")))]
use crate::sys::{self, Timespec};
#[cfg(feature = "rkyv")]
use rkyv::{Archive, Deserialize, Serialize};

use super::fixed::FixedOffset;
use super::{LocalResult, TimeZone};
#[cfg(not(all(target_arch = "wasm32", not(target_os = "wasi"), feature = "wasmbind")))]
use crate::naive::NaiveTime;
use crate::naive::{NaiveDate, NaiveDateTime};
#[cfg(not(all(target_arch = "wasm32", not(target_os = "wasi"), feature = "wasmbind")))]
use crate::sys::{self, Timespec};
use crate::{Date, DateTime};
#[cfg(not(all(target_arch = "wasm32", not(target_os = "wasi"), feature = "wasmbind")))]
use crate::{Datelike, Timelike};
#[cfg(feature = "rkyv")]
use rkyv::{Archive, Deserialize, Serialize};

/// Converts a `time::Tm` struct into the timezone-aware `DateTime`.
/// This assumes that `time` is working correctly, i.e. any error is fatal.
Expand Down
15 changes: 8 additions & 7 deletions src/offset/utc.rs
Expand Up @@ -4,19 +4,20 @@
//! The UTC (Coordinated Universal Time) time zone.

use core::fmt;

use super::{FixedOffset, LocalResult, Offset, TimeZone};
use crate::naive::{NaiveDate, NaiveDateTime};
#[cfg(feature = "clock")]
use crate::{Date, DateTime};
#[cfg(feature = "rkyv")]
use rkyv::{Archive, Deserialize, Serialize};
#[cfg(all(
feature = "clock",
not(all(target_arch = "wasm32", not(target_os = "wasi"), feature = "wasmbind"))
))]
use std::time::{SystemTime, UNIX_EPOCH};

#[cfg(feature = "rkyv")]
use rkyv::{Archive, Deserialize, Serialize};

use super::{FixedOffset, LocalResult, Offset, TimeZone};
use crate::naive::{NaiveDate, NaiveDateTime};
#[cfg(feature = "clock")]
use crate::{Date, DateTime};

/// The UTC time zone. This is the most efficient time zone when you don't need the local time.
/// It is also used as an offset (which is also a dummy type).
///
Expand Down

0 comments on commit c2e9f61

Please sign in to comment.