Skip to content
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

Fix flipperzero::furi::time::Duration::MAX #178

Merged
merged 1 commit into from
Oct 21, 2024
Merged

Fix flipperzero::furi::time::Duration::MAX #178

merged 1 commit into from
Oct 21, 2024

Conversation

dcoles
Copy link
Collaborator

@dcoles dcoles commented Oct 21, 2024

Surprisingly, Duration::MAX was not the maximum possible duration.

Duration::MAX must be able to contain the delta between any two Inteval values, but not every Duration can be used with Interval (if Duration > u32::MAX / 2 then we wouldn't be able to tell if the Instant was in the past or the future).

Surprisingly, `Duration::MAX` was not the maximum possible duration.

`Duration::MAX` must be able to *contain* the delta between any two
`Inteval` values, but not every `Duration` can be used with `Interval`
(if `Duration > u32::MAX / 2` then we wouldn't be able to tell if the
`Instant` was in the past or the future).
@dcoles dcoles requested review from str4d and JarvisCraft October 21, 2024 01:34
@dcoles dcoles merged commit cb902c2 into main Oct 21, 2024
9 checks passed
@dcoles dcoles deleted the fix-duration-max branch October 21, 2024 02:58
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.

2 participants