Skip to content

Conversation

@inkreasing
Copy link
Contributor

@inkreasing inkreasing commented May 11, 2025

Description

Fixes #1290, by checking for an error when formatting with chrono.
Edit: Also updates chrono to use the write_to API.

Additional Notes

If you would like i could also update chrono, which would allow to use the write_to method instead of the rust write! macro. This would probably be faster and it would be more obvious why there could be an error. This also would remove the need to import fmt::Write
Maybe this could be made into a function, but because the Chrono time objects are generic with different types of time this isn't obvious how to do, so i just didn't.

Checklist

Please make sure you can check all the boxes that apply to this PR.

  • I added my changes to CHANGELOG.md, if appropriate.
  • I used cargo fmt to automatically format all code before committing

@elkowar
Copy link
Owner

elkowar commented May 13, 2025

updating chrono sounds quite nice here, go for it!

@inkreasing inkreasing force-pushed the fix_invalid_formattime branch from 4257804 to d138e02 Compare May 14, 2025 05:26
@elkowar elkowar merged commit 98c2201 into elkowar:master May 18, 2025
1 check passed
@inkreasing inkreasing deleted the fix_invalid_formattime branch May 18, 2025 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Wrong format inside "formattime" results in the whole program being unusable

2 participants