Adding is_zero() to core::time::Duration#2814
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