Skip to content

Conversation

@joriskleiber
Copy link

This pull request replaces system::time::Duration with std::time::Duration.

I couldn't find any code that still uses negative duration, so I replaced it with it's std equivalent.
The only place, where I'm not sure if its possible to use an negative duration, is the prior_validity property from the Authentication struct.

Should close #1170

@joriskleiber joriskleiber force-pushed the replace-duration branch 2 times, most recently from 562b268 to 9f08633 Compare July 24, 2025 20:49
@squell squell added the freeze Temporarily blocked from merging pending a release label Jul 28, 2025
@squell squell removed the freeze Temporarily blocked from merging pending a release label Aug 4, 2025
@joriskleiber joriskleiber requested a review from bjorn3 August 7, 2025 11:58
@squell squell added the freeze Temporarily blocked from merging pending a release label Nov 5, 2025
@bjorn3 bjorn3 removed the freeze Temporarily blocked from merging pending a release label Nov 10, 2025
Copy link
Collaborator

@bjorn3 bjorn3 left a 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.

@joriskleiber joriskleiber force-pushed the replace-duration branch 2 times, most recently from 1e63f42 to 25018c0 Compare November 27, 2025 14:46
@joriskleiber joriskleiber requested a review from bjorn3 November 27, 2025 17:42
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")
Copy link
Collaborator

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.

@bjorn3 bjorn3 enabled auto-merge (squash) November 28, 2025 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Investigate replacing system::time::Duration

3 participants