Skip to content

Commit

Permalink
Use checked_(add|sub)_offset in Add and Sub impls
Browse files Browse the repository at this point in the history
  • Loading branch information
pitdicker committed Aug 6, 2023
1 parent 7efcf31 commit b013e92
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/offset/fixed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ impl Add<FixedOffset> for NaiveDateTime {

#[inline]
fn add(self, rhs: FixedOffset) -> NaiveDateTime {
add_with_leapsecond(&self, rhs.local_minus_utc)
self.checked_add_offset(rhs).unwrap()
}
}

Expand All @@ -230,7 +230,7 @@ impl Sub<FixedOffset> for NaiveDateTime {

#[inline]
fn sub(self, rhs: FixedOffset) -> NaiveDateTime {
add_with_leapsecond(&self, -rhs.local_minus_utc)
self.checked_sub_offset(rhs).unwrap()
}
}

Expand Down

0 comments on commit b013e92

Please sign in to comment.