-
Notifications
You must be signed in to change notification settings - Fork 423
Port Clock functions to use Duration class
#19229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
a386db9 to
112a34d
Compare
112a34d to
901f1fe
Compare
anoadragon453
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice readability improvements across the board!
I went through each of the conversions and they looked to be correct. Just a few things below.
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
This makes it easier to create a `Duration` instance in Rust.
3f178e1 to
eb01e9e
Compare
anoadragon453
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks again for doing this!
This changes the arguments in clock functions to be
Durationand converts call sites and constants intoDuration. There are still some more functions around that should be converted (e.g.timeout_deferred), but we leave that to another PR.We also changes
.as_secs()to return a float, as the rounding broke things subtly. The only reason to keep it (its the same astimedelta.total_seconds()) is for symmetry withas_millis().Follows on from #19223
Reviewable commit-by-commit.