Skip to content

Commit

Permalink
Remove obsolete overflow check
Browse files Browse the repository at this point in the history
  • Loading branch information
pitdicker committed Jun 29, 2023
1 parent 9b9a213 commit b6bebc6
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/format/parsed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit b6bebc6

Please sign in to comment.