-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Rename to_jiff_duration
methods to to_duration
#220
Labels
breaking change
Issues that require a breaking change for resolution.
Comments
BurntSushi
added a commit
that referenced
this issue
Jan 25, 2025
This makes the naming with APIs like `Zoned::duration_since` a bit more consistent. And solidifies `SignedDuration` as Jiff's primary non-calendar duration type. I'm open to adding `Span::to_unsigned_duration` in the future, but let's see how far we can get with what we have. Note that `TryFrom<Span> for std::time::Duration` still exists, although that of course only works for non-calendar spans since there is no way to provide a relative reference time. Fixes #220
BurntSushi
added a commit
that referenced
this issue
Jan 25, 2025
This makes the naming with APIs like `Zoned::duration_since` a bit more consistent. And solidifies `SignedDuration` as Jiff's primary non-calendar duration type. I'm open to adding `Span::to_unsigned_duration` in the future, but let's see how far we can get with what we have. Note that `TryFrom<Span> for std::time::Duration` still exists, although that of course only works for non-calendar spans since there is no way to provide a relative reference time. Fixes #220
BurntSushi
added a commit
that referenced
this issue
Jan 25, 2025
This makes the naming with APIs like `Zoned::duration_since` a bit more consistent. And solidifies `SignedDuration` as Jiff's primary non-calendar duration type. I'm open to adding `Span::to_unsigned_duration` in the future, but let's see how far we can get with what we have. Note that `TryFrom<Span> for std::time::Duration` still exists, although that of course only works for non-calendar spans since there is no way to provide a relative reference time. Fixes #220
BurntSushi
added a commit
that referenced
this issue
Jan 27, 2025
This makes the naming with APIs like `Zoned::duration_since` a bit more consistent. And solidifies `SignedDuration` as Jiff's primary non-calendar duration type. I'm open to adding `Span::to_unsigned_duration` in the future, but let's see how far we can get with what we have. Note that `TryFrom<Span> for std::time::Duration` still exists, although that of course only works for non-calendar spans since there is no way to provide a relative reference time. Fixes #220
BurntSushi
added a commit
that referenced
this issue
Jan 30, 2025
This makes the naming with APIs like `Zoned::duration_since` a bit more consistent. And solidifies `SignedDuration` as Jiff's primary non-calendar duration type. I'm open to adding `Span::to_unsigned_duration` in the future, but let's see how far we can get with what we have. Note that `TryFrom<Span> for std::time::Duration` still exists, although that of course only works for non-calendar spans since there is no way to provide a relative reference time. Fixes #220
BurntSushi
added a commit
that referenced
this issue
Feb 1, 2025
This makes the naming with APIs like `Zoned::duration_since` a bit more consistent. And solidifies `SignedDuration` as Jiff's primary non-calendar duration type. I'm open to adding `Span::to_unsigned_duration` in the future, but let's see how far we can get with what we have. Note that `TryFrom<Span> for std::time::Duration` still exists, although that of course only works for non-calendar spans since there is no way to provide a relative reference time. Fixes #220
BurntSushi
added a commit
that referenced
this issue
Feb 2, 2025
This makes the naming with APIs like `Zoned::duration_since` a bit more consistent. And solidifies `SignedDuration` as Jiff's primary non-calendar duration type. I'm open to adding `Span::to_unsigned_duration` in the future, but let's see how far we can get with what we have. Note that `TryFrom<Span> for std::time::Duration` still exists, although that of course only works for non-calendar spans since there is no way to provide a relative reference time. Fixes #220
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
to_duration
methods were originally added to supportstd::time::Duration
. They were added before I addedjiff::SignedDuration
.A
jiff::SignedDuration
should be the "default" non-calendar duration in Jiff. Soto_duration
methods should returnjiff::SignedDuration
.If callers need a
std::time::Duration
, they can convert from ajiff::SignedDuration
viaTryFrom
impls.The
to_duration
methods were deprecated injiff 0.1
.The text was updated successfully, but these errors were encountered: