Experiences when adapting rustic to jiff #464
Replies: 2 comments
-
|
Thank you for the feedback! I'm glad to hear that things mostly went well. :-) For For things like For "best effort parsing," I've actually written my own variant of this for Biff: https://github.com/BurntSushi/biff/blob/f33954f27c86644d59ad283ce753b992ac40a82f/src/datetime.rs#L363-L426 I am not, at present at least, inclined to add something like this to Jiff. I think it's better that Jiff adhere to interoperable formats with specifications for them. (The "friendly" format is the only thing in Jiff that is bespoke. But there were, IMO, very compelling reasons to add that.) I think "best effort" approaches can get folks into trouble. As you say, you've learned that just date + time + offset is not really ideal. The fact that Jiff doesn't have a paved path for that format for I think that if something like that is ever added, it will probably come in the form of an opt-in |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for your remarks! About About parsing/serialization you are right - I meant I had to write own wrappers for integrating the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi @BurntSushi
I adopted my project to use jiff (see rustic-rs/rustic_core#452; mainly to get rid of the
humantimedependency which has a RUSTSEC warning) - and must say that I really like what you have done! The structs are very easy and intuitively to use. Also it automatically made me think of edge cases and using the very good and structured docu, I learned a lot about date/time handling and stumbling block in this area ;-) Great job!So, most things went very smooth, however there are 2 things I want to mention here:
"2025-12-26T20:27:14.962535153+01:00". Now, I've learned that this is actually a bad idea, however, alas , changing this is not possible as it would break backwards compatibility and restic compatibility. So, I had to write my own parser/serializer, see https://github.com/rustic-rs/rustic_core/pull/452/files#diff-503d9055416fab688f096fb1d40d17e827daf7013759d4a0154edcf9bed851aaR62. I wonder if such a "best-effort-parsing" could be contained directly in jiff...day_of_year()ormonth(), you sometimes need results starting with0. chrono had the0variants, e.g.month0()(see https://github.com/rustic-rs/rustic_core/pull/452/files#diff-1d3e32348f9171504c88f13ddac1b4552da512c4525bdcdc042e5ce1029736cfR109) - would that be something to add to the jiff API?Beta Was this translation helpful? Give feedback.
All reactions