Skip to content

Commit

Permalink
Warn on future deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
jhpratt committed Aug 22, 2021
1 parent a839969 commit fefc8c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/duration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ impl Duration {
pub const WEEK: Self = Self::weeks(1);

/// The minimum possible duration. Adding any negative duration to this will cause an overflow.
pub const MIN: Self = Self::new_unchecked(i64::min_value(), -999_999_999);
pub const MIN: Self = Self::new_unchecked(i64::MIN, -999_999_999);

/// The maximum possible duration. Adding any positive duration to this will cause an overflow.
pub const MAX: Self = Self::new_unchecked(i64::max_value(), 999_999_999);
pub const MAX: Self = Self::new_unchecked(i64::MAX, 999_999_999);
// endregion constants

// region: is_{sign}
Expand Down Expand Up @@ -941,7 +941,7 @@ impl PartialEq<Duration> for StdDuration {

impl PartialOrd<StdDuration> for Duration {
fn partial_cmp(&self, rhs: &StdDuration) -> Option<Ordering> {
if rhs.as_secs() > i64::max_value() as _ {
if rhs.as_secs() > i64::MAX as _ {
return Some(Ordering::Less);
}

Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
clippy::unwrap_in_result,
clippy::unwrap_used,
clippy::use_debug,
deprecated_in_future,
missing_copy_implementations,
missing_debug_implementations,
unused_qualifications,
Expand Down

0 comments on commit fefc8c7

Please sign in to comment.