-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Tracking issue for 'checked_duration_since' feature #58402
Comments
Some use cases from @vi:
|
This comment has been minimized.
This comment has been minimized.
I just had good use for
|
I do like However, I personally don't see the benefit of In the example posted above, regarding if now < deadline {
sleeper.sleep(deadline - now);
} The author hint that they would like to shorten it to: sleeper.sleep(deadline.saturating_duration_since(now)); But it feels wasteful* to call sleep when we don't want to sleep, and I would personally have used: if let Some(time_left) = deadline.checked_duration_since(now) {
sleeper.sleep(time_left);
} If someone really want a saturating computation it's not that many extra characters to type *: Assuming |
…, r=alexcrichton Stabilize checked_duration_since for 1.38.0 Looks like it has already found some use in projects. Resolves rust-lang#58402.
Removing nomination since this is covered by #62860 |
…, r=Mark-Simulacrum Stabilize checked_duration_since for 1.38.0 Looks like it has already found some use in projects. Resolves rust-lang#58402.
…, r=Mark-Simulacrum Stabilize checked_duration_since for 1.38.0 Looks like it has already found some use in projects. Resolves rust-lang#58402.
…=Mark-Simulacrum Clean up unstable book - rust-lang#58402's feature was renamed to `tidy_test_never_used_anywhere_else` and it is now used for tidy only - `read_initializer` link is wrong and the doc should be auto-generated so removed - Add dummy doc for `link_cfg` - Stop generating `compiler_builtins_lib` doc in favor of b8ccc0f - Make `rustc_attrs` tracking issue "None"
…=Mark-Simulacrum Clean up unstable book - rust-lang#58402's feature was renamed to `tidy_test_never_used_anywhere_else` and it is now used for tidy only - `read_initializer` link is wrong and the doc should be auto-generated so removed - Add dummy doc for `link_cfg` - Stop generating `compiler_builtins_lib` doc in favor of b8ccc0f - Make `rustc_attrs` tracking issue "None"
There going to be checked analogues of offseting
Instant
s byDuration
s, but I see no analogue of non-panicking calculation ofDuration
from a pair ofInstant
s.Note: this issue is referred by
#[unstable]
in the pull request.The text was updated successfully, but these errors were encountered: