Closed CryZe closed 1 year ago
Merging #576 (d6cdb26) into main (22ae579) will increase coverage by
0.0%
. The diff coverage is100.0%
.
@@ Coverage Diff @@
## main #576 +/- ##
=====================================
Coverage 95.7% 95.7%
=====================================
Files 79 79
Lines 8779 8795 +16
=====================================
+ Hits 8405 8421 +16
Misses 374 374
Impacted Files | Coverage Δ | |
---|---|---|
time/src/duration.rs | 100.0% <100.0%> (ø) |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
Having this code and the code from std
side-by-side, I've (unsurprisingly) confirmed that it is the same for everything except where noted. I initially questioned the use of break 'value ...
, but then realized the context in quick the macro was being used meant that a simple return
would not suffice.
I have no changes to request, so I'm merging it as-is. Thank you for the PR!
This ports the algorithm for constructing
Duration
from floating point seconds fromstd
. The new algorithm instd
uses bit manipulation to construct theDuration
with the most precision possible. Additionally this addssaturating
andchecked
variants of those functions.Original
std
PR: https://github.com/rust-lang/rust/pull/90247