Skip to content

Commit

Permalink
Rename oldtime module to duration
Browse files Browse the repository at this point in the history
  • Loading branch information
pitdicker committed May 31, 2023
1 parent 12461a6 commit 897567e
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ use core::{fmt, hash};
#[cfg(feature = "rkyv")]
use rkyv::{Archive, Deserialize, Serialize};

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

Expand Down Expand Up @@ -578,7 +578,7 @@ where
mod tests {
use super::Date;

use crate::oldtime::Duration;
use crate::duration::Duration;
use crate::{FixedOffset, NaiveDate, Utc};

#[cfg(feature = "clock")]
Expand Down
2 changes: 1 addition & 1 deletion src/datetime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use std::string::ToString;
#[cfg(any(feature = "std", test))]
use std::time::{SystemTime, UNIX_EPOCH};

use crate::duration::Duration as OldDuration;
#[cfg(any(feature = "alloc", feature = "std", test))]
use crate::format::DelayedFormat;
#[cfg(feature = "unstable-locales")]
Expand All @@ -29,7 +30,6 @@ use crate::naive::{Days, IsoWeek, NaiveDate, NaiveDateTime, NaiveTime};
#[cfg(feature = "clock")]
use crate::offset::Local;
use crate::offset::{FixedOffset, Offset, TimeZone, Utc};
use crate::oldtime::Duration as OldDuration;
#[allow(deprecated)]
use crate::Date;
use crate::Months;
Expand Down
2 changes: 1 addition & 1 deletion src/datetime/tests.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use std::time::{SystemTime, UNIX_EPOCH};

use super::DateTime;
use crate::duration::Duration;
use crate::naive::{NaiveDate, NaiveTime};
use crate::offset::{FixedOffset, TimeZone, Utc};
#[cfg(feature = "clock")]
use crate::offset::{Local, Offset};
use crate::oldtime::Duration;
use crate::{Datelike, Days, LocalResult, Months, NaiveDateTime};

#[derive(Clone)]
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/format/parsed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
//! They can be constructed incrementally while being checked for consistency.
use super::{ParseResult, IMPOSSIBLE, NOT_ENOUGH, OUT_OF_RANGE};
use crate::duration::Duration as OldDuration;
use crate::naive::{NaiveDate, NaiveDateTime, NaiveTime};
use crate::offset::{FixedOffset, LocalResult, Offset, TimeZone};
use crate::oldtime::Duration as OldDuration;
use crate::DateTime;
use crate::Weekday;
use crate::{Datelike, Timelike};
Expand Down
5 changes: 2 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,8 @@
#![cfg_attr(feature = "rustc-serialize", allow(deprecated))]
#![cfg_attr(docsrs, feature(doc_cfg))]

mod oldtime;
// this reexport is to aid the transition and should not be in the prelude!
pub use oldtime::{Duration, OutOfRangeError};
mod duration;
pub use duration::{Duration, OutOfRangeError};

use core::fmt;

Expand Down
4 changes: 2 additions & 2 deletions src/naive/date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use rkyv::{Archive, Deserialize, Serialize};
#[cfg(feature = "unstable-locales")]
use pure_rust_locales::Locale;

use crate::duration::Duration as OldDuration;
#[cfg(any(feature = "alloc", feature = "std", test))]
use crate::format::DelayedFormat;
use crate::format::{
Expand All @@ -23,7 +24,6 @@ use crate::format::{
};
use crate::month::Months;
use crate::naive::{IsoWeek, NaiveDateTime, NaiveTime};
use crate::oldtime::Duration as OldDuration;
use crate::{Datelike, Duration, Weekday};

use super::internals::{self, DateImpl, Mdf, Of, YearFlags};
Expand Down Expand Up @@ -2284,7 +2284,7 @@ mod tests {
use super::{
Days, Months, NaiveDate, MAX_DAYS_FROM_YEAR_0, MAX_YEAR, MIN_DAYS_FROM_YEAR_0, MIN_YEAR,
};
use crate::oldtime::Duration;
use crate::duration::Duration;
use crate::{Datelike, Weekday};
use std::{i32, u32};

Expand Down
2 changes: 1 addition & 1 deletion src/naive/datetime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ use core::{fmt, str};
#[cfg(feature = "rkyv")]
use rkyv::{Archive, Deserialize, Serialize};

use crate::duration::Duration as OldDuration;
#[cfg(any(feature = "alloc", feature = "std", test))]
use crate::format::DelayedFormat;
use crate::format::{parse, parse_and_remainder, ParseError, ParseResult, Parsed, StrftimeItems};
use crate::format::{Fixed, Item, Numeric, Pad};
use crate::naive::{Days, IsoWeek, NaiveDate, NaiveTime};
use crate::offset::Utc;
use crate::oldtime::Duration as OldDuration;
use crate::{DateTime, Datelike, LocalResult, Months, TimeZone, Timelike, Weekday};

#[cfg(feature = "rustc-serialize")]
Expand Down
2 changes: 1 addition & 1 deletion src/naive/datetime/tests.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use super::NaiveDateTime;
use crate::oldtime::Duration;
use crate::duration::Duration;
use crate::NaiveDate;
use crate::{Datelike, FixedOffset, Utc};
use std::i64;
Expand Down
2 changes: 1 addition & 1 deletion src/naive/time/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ use core::{fmt, str};
#[cfg(feature = "rkyv")]
use rkyv::{Archive, Deserialize, Serialize};

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

#[cfg(feature = "rustc-serialize")]
Expand Down
2 changes: 1 addition & 1 deletion src/naive/time/tests.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use super::NaiveTime;
use crate::oldtime::Duration;
use crate::duration::Duration;
use crate::Timelike;
use std::u32;

Expand Down
2 changes: 1 addition & 1 deletion src/offset/fixed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ use core::ops::{Add, Sub};
use rkyv::{Archive, Deserialize, Serialize};

use super::{LocalResult, Offset, TimeZone};
use crate::duration::Duration as OldDuration;
use crate::naive::{NaiveDate, NaiveDateTime, NaiveTime};
use crate::oldtime::Duration as OldDuration;
use crate::DateTime;
use crate::Timelike;

Expand Down
2 changes: 1 addition & 1 deletion src/round.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// See README.md and LICENSE.txt for details.

use crate::datetime::DateTime;
use crate::oldtime::Duration;
use crate::duration::Duration;
use crate::NaiveDateTime;
use crate::TimeZone;
use crate::Timelike;
Expand Down

0 comments on commit 897567e

Please sign in to comment.