-
Notifications
You must be signed in to change notification settings - Fork 543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix parse panic #686
Fix parse panic #686
Conversation
|
||
// 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()))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, now that I'm looking at this in context I'm having second thoughts. What would it take to move this check into TimeZone::from_local_datetime()
? Can you check what happens to that method in #677?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem I see is that TimeZone::from_local_datetime()
returns a LocalResult
, and I think it would be counter-intuitive if it returned LocalResult::None
for that.
Thank you for working on this! |
dfc4027
to
ce0a2d7
Compare
ce0a2d7
to
bfddc1e
Compare
I had trouble fixing the merge conflict somehow, but it should be good now |
4545f9e
to
307b82e
Compare
Thanks! |
This is to resolve #645. The test was previously panicking when subtracting the
FixedOffset
from theNaiveDateTime
. There may be other places that use that subtraction that we want to look at in the future.