-
Notifications
You must be signed in to change notification settings - Fork 137
Replace system::time::Duration with std::time::Duration
#1207
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
base: main
Are you sure you want to change the base?
Replace system::time::Duration with std::time::Duration
#1207
Conversation
562b268 to
9f08633
Compare
9f08633 to
928dd57
Compare
bjorn3
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.
Apologies for the late review. Looks like there are a couple of minor merge conflicts. Just conflicts in use items.
1e63f42 to
25018c0
Compare
25018c0 to
563aacd
Compare
| fn add(self, rhs: Duration) -> Self::Output { | ||
| Duration::new(self.secs + rhs.secs, self.nsecs + rhs.nsecs) | ||
| self.checked_add(rhs) | ||
| .expect("overflow when adding duration") |
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.
This introduces a panic that is theoretically reachable, but in practice I don't think you can hit it within the lifetime of the universe given that SystemTime uses i64 as seconds field and all durations in the config file are limited to a value much less than that.
This pull request replaces
system::time::Durationwithstd::time::Duration.I couldn't find any code that still uses negative duration, so I replaced it with it's
stdequivalent.The only place, where I'm not sure if its possible to use an negative duration, is the
prior_validityproperty from theAuthenticationstruct.Should close #1170