7
Github Tracking Issue for `Duration` saturating operations · Issue #76416 · rust...
source link: https://github.com/rust-lang/rust/issues/76416
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
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
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()
? - Should
Duration::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()
.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK