-
Notifications
You must be signed in to change notification settings - Fork 40
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
feat(wkt): Support jiff From conversions for Duration and Timestamp #1154
Conversation
…oogleapis#1153) jiff is a promising time handling crate based on the design of the Temporal JavaScript API. It is planned for a long-term 1.0 version to be released later in the year. This commit adds support for converting to and from `jiff::SignedDuration` and `jiff::Timestamp` for version 0.2.
Generally this looks good. I assume the motivation for naming the feature PS: not asking you to change anything yet, just trying to understand motivations and tradeoffs. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1154 +/- ##
==========================================
+ Coverage 96.10% 96.14% +0.03%
==========================================
Files 35 35
Lines 1388 1399 +11
==========================================
+ Hits 1334 1345 +11
Misses 54 54 ☔ View full report in Codecov by Sentry. |
I came across this idea in, for example, https://github.com/sfackler/rust-postgres/blob/master/postgres/Cargo.toml where it seemed like a nice approach for supporting multiple crates - in the case where it's implementing trait implementations for your own traits and third party types. I firstly thought it would make it easier to transition between jiff 0.2 and jiff 1.0, because it unties the strict need to update both libraries simultaneously. But at the end of the day, the benefit here is definitely minor, and I can switch to just calling the feature |
Updated the feature name as Also updated the |
I think we are going to wait until I hope you do not feel like you wasted a lot of time on this. We are still refining our thinking about how to manage deps for Rust. |
No hard feelings here - it's fair. Also given the beta nature of both these libraries at this point in time, it's not going to inconvenience a lot of users. I'll close this PR for now, but you can use it as reference code in the future if you want. |
jiff is a promising time handling crate based on the design of the Temporal JavaScript API. It is planned for a long-term 1.0 version to be released later in the year.
This commit adds support for converting to and from
jiff::SignedDuration
andjiff::Timestamp
for version 0.2.To ease the transition between version 0.2 and 1.0, I've named the feature
jiff-0_2
, so that support for multiple versions could coexist. But if preferred, I can rename the feature to justjiff
.Fixes #1153