-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Adding is_zero() to core::time::Duration #2814
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
Conversation
Sort of prior art, albeit in progress and unreleased: I'm rewriting the time crate, and included this exact method. It is slightly different in that the implementation allows for both positive and negative durations, and there are corresponding methods. I fully support, though! Even though I don't think an RFC is necessary for something like this :) |
A couple of notes:
|
👍 On adding @joshtriplett mentioned And as mentioned in the issue you opened, it would have probably been fine to directly create a PR on the main repo. It's a really small change. |
- Added `zero()` as one alternative and future possibility. - Removed some drawbacks of `ZERO` alternative.
Thanks. I've updated the file. I will create new PR if this RFC would be changed to "final comment period" state (like in guideline). It would prevent a lot of changes from time to time, while this RFC is being updated. |
This really doesn't have to go through the full RFC process, a PR on rust-lang/rust is just fine. Closing in favor of that. |
@jonas-schievink #2809 can be closed as well, then, I believe. |
This PR is for adding new function
is_zero()
tocore::time::Duration
.Related issue: #2809