-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-timeArea: TimeArea: TimeC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCLibs-TrackedLibs issues that are tracked on the team's project board.Libs issues that are tracked on the team's project board.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.
Description
This is a tracking issue for Duration
saturating operations.
The feature gate for the issue is #![feature(duration_saturating_ops)]
.
impl Duration {
pub const fn saturating_add(self, rhs: Duration) -> Duration {}
pub const fn saturating_sub(self, rhs: Duration) -> Duration {}
pub const fn saturating_mul(self, rhs: u32) -> Duration {}
}
Steps
- Implement the proposal: Add saturating methods for
Duration
#76114 - FCP
- Stabilization PR: Stabilize feature
duration_saturating_ops
#84090
Unresolved Questions
Do we want associated constants similar to the ones that already exist for integer types or associated methods? (ie:Duration::MIN
orDuration::min()
?ShouldDuration::MIN
be replaced byDuration::zero()
? They are currently equivalent but one can image a future whereDuration
is able to hold negative duration and thus makingMIN
different fromzero()
.
matklad, MortenLohne, tyranron, passcod, KyleNBurke and 1 more
Metadata
Metadata
Assignees
Labels
A-timeArea: TimeArea: TimeC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCLibs-TrackedLibs issues that are tracked on the team's project board.Libs issues that are tracked on the team's project board.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.