Skip to content

Commit

Permalink
Delete div module in favor of direct imports
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Mar 22, 2022
1 parent 65dd625 commit b72d747
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 52 deletions.
41 changes: 0 additions & 41 deletions src/div.rs

This file was deleted.

1 change: 0 additions & 1 deletion src/format/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,6 @@ fn format_inner<'a>(
)
};

use crate::div::{div_floor, mod_floor};
use core::fmt::Write;

match *item {
Expand Down
4 changes: 2 additions & 2 deletions src/format/parsed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
//! A collection of parsed date and time items.
//! They can be constructed incrementally while being checked for consistency.
use crate::oldtime::Duration as OldDuration;
use num_integer::div_rem;
use num_traits::ToPrimitive;

use super::{ParseResult, IMPOSSIBLE, NOT_ENOUGH, OUT_OF_RANGE};
use crate::div::div_rem;
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
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,6 @@ macro_rules! try_opt {
};
}

mod div;
pub mod offset;
pub mod naive {
//! Date and time types unconcerned with timezones.
Expand Down
2 changes: 1 addition & 1 deletion src/naive/date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ use crate::oldtime::Duration as OldDuration;
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;

use crate::div::div_mod_floor;
#[cfg(any(feature = "alloc", feature = "std", test))]
use crate::format::DelayedFormat;
use crate::format::{parse, ParseError, ParseResult, Parsed, StrftimeItems};
Expand Down
2 changes: 1 addition & 1 deletion src/naive/datetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ use crate::oldtime::Duration as OldDuration;
use core::borrow::Borrow;
use core::ops::{Add, AddAssign, Sub, SubAssign};
use core::{fmt, hash, str};
use num_integer::div_mod_floor;
use num_traits::ToPrimitive;

use crate::div::div_mod_floor;
#[cfg(any(feature = "alloc", feature = "std", test))]
use crate::format::DelayedFormat;
use crate::format::{parse, ParseError, ParseResult, Parsed, StrftimeItems};
Expand Down
2 changes: 1 addition & 1 deletion src/naive/internals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
#![allow(dead_code)] // some internal methods have been left for consistency
#![cfg_attr(feature = "__internal_bench", allow(missing_docs))]

use crate::div::{div_rem, mod_floor};
use crate::Weekday;
use core::{fmt, i32};
use num_integer::{div_rem, mod_floor};
use num_traits::FromPrimitive;

/// The internal date representation. This also includes the packed `Mdf` value.
Expand Down
4 changes: 2 additions & 2 deletions src/naive/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@

//! ISO 8601 time 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, hash, str};
use num_integer::div_mod_floor;

use crate::div::div_mod_floor;
#[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;

pub(super) const MIN_TIME: NaiveTime = NaiveTime { secs: 0, frac: 0 };
Expand Down
3 changes: 1 addition & 2 deletions src/offset/fixed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@

//! The time zone which has a fixed offset from UTC.
use crate::oldtime::Duration as OldDuration;
use core::fmt;
use core::ops::{Add, Sub};
use num_integer::div_mod_floor;

use super::{LocalResult, Offset, TimeZone};
use crate::div::div_mod_floor;
use crate::naive::{NaiveDate, NaiveDateTime, NaiveTime};
use crate::DateTime;
use crate::Timelike;
Expand Down

0 comments on commit b72d747

Please sign in to comment.