-
-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix date format panic #167
Conversation
It is possible for this unwrap to panic. Replaced with a match to hand the success and fail case. The Err() may still be improved.
This Err() still needs to be handled more correctly. I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also support formats like "2023-1-31" or "2023-1-1", it is better than simply printing errors. What do you think?
It breaks from the standard. It could be done. But I don’t think it’s the right option. Probably have the string reformatted. Then have that written back to to the article struct. Then you need to overwrite the zine.toml so that it stays fixed. This issue would only happen if someone manually adjusted the date. If the server handles it. It teaches the users not to follow the standard. I think it would be best to let the error occur so the author fixes it and learns the correct format. On Feb 9, 2023, at 11:24, Folyd ***@***.***> wrote:
@Folyd commented on this pull request.
Can we also support formats like "2023-1-31" or "2023-1-1", it is better than simply printing errors. What do you think?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Yes, fair enough. 👍 |
In addition. If it was ever decided to add time. There would be more issues and breakages. |
Don't forget to run |
Sorry. I will try to get into the habit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks.
The code will still panic in
debug
mode. It will close cleanly in productionThis should close #164