Skip to content

Commit

Permalink
fix(prost-types): Allow unknown local time offset (#1109)
Browse files Browse the repository at this point in the history
`chrono` allows a negative zero local offset. I think we should follow their example.

The RFC 3339 spec says this is a special value, but doesn't specify how to handle the situation.
https://www.rfc-editor.org/rfc/rfc3339#section-4.3
  • Loading branch information
caspermeijn authored Aug 2, 2024
1 parent d16bed8 commit 7e55cda
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions prost-types/src/datetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,6 @@ fn parse_offset(s: &str) -> Option<(i8, i8, &str)> {
(minute, s)
};

// '-00:00' indicates an unknown local offset.
ensure!(is_positive || hour > 0 || minute > 0);

ensure!(hour < 24 && minute < 60);

let hour = hour as i8;
Expand Down

0 comments on commit 7e55cda

Please sign in to comment.