You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// -- passes as expected since seconds are too largeassert_eq!(None, NaiveTime::from_hms_opt(11, 22, 60));// -- bug: should pass because seconds are too largeassert!(NaiveTime::parse_from_str("11:22:60", "%H:%M:%S").is_err());
At a minimum, we have inconsistent handling for seconds that are too large.
Here's a playground link with the same assertions:
So this is an interesting case because there is some support for leap seconds in chrono, and we represent those as having a 60th second. However, apparently we might not allow parsing the 60th second, which may or may not be a defensible choice. The inconsistency is unfortunate, but I honestly don't have a strong opinion on how to improve this.
Here's an minimal recreation
At a minimum, we have inconsistent handling for seconds that are too large.
Here's a playground link with the same assertions:
The text was updated successfully, but these errors were encountered: