From b6bebc682d863ce84d0b029a4cbc4efc6fb1ef1d Mon Sep 17 00:00:00 2001 From: Paul Dicker Date: Fri, 19 May 2023 19:07:21 +0200 Subject: [PATCH] Remove obsolete overflow check --- src/format/parsed.rs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/format/parsed.rs b/src/format/parsed.rs index 809a5ae782..b8f8695dbd 100644 --- a/src/format/parsed.rs +++ b/src/format/parsed.rs @@ -636,11 +636,6 @@ impl Parsed { let datetime = self.to_naive_datetime_with_offset(offset)?; let offset = FixedOffset::east_opt(offset).ok_or(OUT_OF_RANGE)?; - // this is used to prevent an overflow when calling FixedOffset::from_local_datetime - datetime - .checked_sub_signed(OldDuration::seconds(i64::from(offset.local_minus_utc()))) - .ok_or(OUT_OF_RANGE)?; - match offset.from_local_datetime(&datetime) { LocalResult::None => Err(IMPOSSIBLE), LocalResult::Single(t) => Ok(t),