Switch to using Duration with HiffyContext#672
Merged
Conversation
151462c to
4558793
Compare
4558793 to
ae7ac7d
Compare
hawkw
approved these changes
May 20, 2026
| let hubris = &context.cli.archive()?; | ||
| let core = &mut *context.cli.attach_live_booted(hubris)?; | ||
| let mut worker = AuxFlashHandler::new(hubris, core, subargs.timeout)?; | ||
| let timeout = std::time::Duration::from_millis(subargs.timeout); |
Member
There was a problem hiding this comment.
i suppose the alternative to this could be to write a wrapper type which has a FromStr implementation that parses an integer and then Duration::from_millises it, but...meh. This seems fine.
Contributor
There was a problem hiding this comment.
I had the same thought, and the same "...meh" reaction
Comment on lines
+41
to
+42
| hiffy_timeout: u64, | ||
| poll_interval: u64, |
Member
There was a problem hiding this comment.
personally I feel like maybe we ought to accept these as Durations here and make the caller do that, but maybe it's annoyinger that way?
mkeeter
approved these changes
May 20, 2026
ae7ac7d to
0721b97
Compare
This makes it much clearer for eventually doing humility as a library. There's not a nice way to have clap automatically parse a duration but we can at least change all the arguments to be a `u64` to easily pass to Duration.
0721b97 to
b2ffffc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This makes it much clearer for eventually doing humility as a library. There's not a nice way to have clap automatically parse a duration but we can at least change all the arguments to be a
u64to easily pass to Duration.