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 28, 2023
1 parent fd44845 commit c8abde2
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 @@ -19,7 +19,7 @@ use crate::format::Locale;
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::duration::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 @@ -29,7 +29,7 @@ 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;
use crate::duration::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
Expand Up @@ -5,7 +5,7 @@ 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::duration::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 @@ -9,7 +9,7 @@ use core::convert::TryFrom;
use super::{ParseResult, IMPOSSIBLE, NOT_ENOUGH, OUT_OF_RANGE};
use crate::naive::{NaiveDate, NaiveDateTime, NaiveTime};
use crate::offset::{FixedOffset, LocalResult, Offset, TimeZone};
use crate::oldtime::Duration as OldDuration;
use crate::duration::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 @@ -24,7 +24,7 @@ use crate::format::{
};
use crate::month::Months;
use crate::naive::{IsoWeek, NaiveDateTime, NaiveTime};
use crate::oldtime::Duration as OldDuration;
use crate::duration::Duration as OldDuration;
use crate::{Datelike, Duration, Weekday};

use super::internals::{self, DateImpl, Mdf, Of, YearFlags};
Expand Down Expand Up @@ -2282,7 +2282,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::{
convert::{TryFrom, TryInto},
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 @@ -19,7 +19,7 @@ use crate::format::{parse, parse_and_remainder, ParseError, ParseResult, Parsed,
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::duration::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 @@ -17,7 +17,7 @@ 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::duration::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 @@ -11,7 +11,7 @@ use rkyv::{Archive, Deserialize, Serialize};

use super::{LocalResult, Offset, TimeZone};
use crate::naive::{NaiveDate, NaiveDateTime, NaiveTime};
use crate::oldtime::Duration as OldDuration;
use crate::duration::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 c8abde2

Please sign in to comment.