From 7e55cdaa8123d21987d6ef972b8e4052076ef348 Mon Sep 17 00:00:00 2001 From: Casper Meijn Date: Fri, 2 Aug 2024 14:58:14 +0200 Subject: [PATCH] fix(prost-types): Allow unknown local time offset (#1109) `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 --- prost-types/src/datetime.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/prost-types/src/datetime.rs b/prost-types/src/datetime.rs index 4bdc8fa55..69bc10292 100644 --- a/prost-types/src/datetime.rs +++ b/prost-types/src/datetime.rs @@ -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;