Skip to content

Commit

Permalink
move MIN_UTC, MAX_UTC to a specialized impl
Browse files Browse the repository at this point in the history
  • Loading branch information
petar-dambovaliev authored and pitdicker committed Sep 21, 2023
1 parent b64cedc commit d23e049
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/datetime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -545,11 +545,6 @@ impl<Tz: TimeZone> DateTime<Tz> {
.expect("writing rfc3339 datetime to string should never fail");
result
}

/// The minimum possible `DateTime<Utc>`.
pub const MIN_UTC: DateTime<Utc> = DateTime { datetime: NaiveDateTime::MIN, offset: Utc };
/// The maximum possible `DateTime<Utc>`.
pub const MAX_UTC: DateTime<Utc> = DateTime { datetime: NaiveDateTime::MAX, offset: Utc };
}

impl Default for DateTime<Utc> {
Expand Down Expand Up @@ -831,6 +826,11 @@ impl DateTime<Utc> {
pub fn parse_from_str(s: &str, fmt: &str) -> ParseResult<DateTime<Utc>> {
DateTime::<FixedOffset>::parse_from_str(s, fmt).map(|result| result.into())
}

/// The minimum possible `DateTime<Utc>`.
pub const MIN_UTC: Self = DateTime { datetime: NaiveDateTime::MIN, offset: Utc };
/// The maximum possible `DateTime<Utc>`.
pub const MAX_UTC: Self = DateTime { datetime: NaiveDateTime::MAX, offset: Utc };
}

impl<Tz: TimeZone> DateTime<Tz>
Expand Down

0 comments on commit d23e049

Please sign in to comment.