Remove partial support for handling -0000
offset
#1411
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
RFC 2822 and others have a special encoding to indicate the offset of a datetime is unknown:
-00:00
.We currently have code in
format::parse
that ensures we do not provide an offset to theParsed
struct if the offset is-0000
.timezone_offset_2822
returns anOption<i32>
that should beNone
to differentiate this case from+0000
.But then
timezone_offset_2822
does returnSome(0)
on the-0000
input. That makes theOption
and the code to handle it useless.I would like to see proper support for encoding this value in a
FixedOffset
, as in #1042.But for now the inconsistency just messes up the error variants we return.
Because I am currently working on converting the parsing code from
ParsedError
to a newError
type for 0.5, I just need something consistent to work on.