Skip to content

Is panic on invalid format string normal? #294

Closed Answered by jhpratt
zhiburt asked this question in Question
Discussion options

You must be logged in to vote

Yes, this was a design choice made, as an invalid format description is almost certainly a programmer error. If you are using a user-inputted format description, you should validate it with time::util::validate_format_string to avoid panicking.

In time 0.3, the parsing of the format description and the formatting/parsing itself is split into two stages, such that an invalid format description can be handled independently.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@zhiburt
Comment options

Answer selected by zhiburt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #294 on November 12, 2020 10:57.