From b013e926625202881d85882068d215adb41804fd Mon Sep 17 00:00:00 2001 From: Paul Dicker Date: Fri, 19 May 2023 14:43:45 +0200 Subject: [PATCH] Use `checked_(add|sub)_offset` in `Add` and `Sub` impls --- src/offset/fixed.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/offset/fixed.rs b/src/offset/fixed.rs index a835173846..65479a5659 100644 --- a/src/offset/fixed.rs +++ b/src/offset/fixed.rs @@ -221,7 +221,7 @@ impl Add for NaiveDateTime { #[inline] fn add(self, rhs: FixedOffset) -> NaiveDateTime { - add_with_leapsecond(&self, rhs.local_minus_utc) + self.checked_add_offset(rhs).unwrap() } } @@ -230,7 +230,7 @@ impl Sub for NaiveDateTime { #[inline] fn sub(self, rhs: FixedOffset) -> NaiveDateTime { - add_with_leapsecond(&self, -rhs.local_minus_utc) + self.checked_sub_offset(rhs).unwrap() } }