mirror of
https://github.com/chronotope/chrono.git
synced 2025-10-02 15:26:12 +00:00
Remove obsolete overflow check
This commit is contained in:
parent
cf62e4648c
commit
0032431491
@ -634,11 +634,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),
|
||||
|
Loading…
x
Reference in New Issue
Block a user