-
Notifications
You must be signed in to change notification settings - Fork 6
Util Module Improvements #85
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
Merged
Merged
Conversation
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
6088278 to
1d1c2aa
Compare
Signed-off-by: james-parky <[email protected]>
This constant is intrinsically connected to the retry_loop() function and therefore doesn't make sense to be free -- it is not used anywhere else. Signed-off-by: james-parky <[email protected]>
A slight refactor to the retry_loop() function to make it more idiomatic
and shorter.
- Rather than have a u64 representing the retry interval, just make it a
Duration, which is what it is. This also allows you to drop the
INTERVAL_MSEC suffix as the fact it is built with Duration::from_millis
makes that clear.
- Rather than using a infinite loop {}, just use a regular for loop of
max_tries - 1. If all attempts at calling func() have resulted in an Err
when we exit this for loop, we just return calling func() for the last
time.
- There is no need to @-bind err in the Err match arm since it is not used
anyway, so simplify with just a match on Err(_).
- Similarly, remove the @-binding for the Ok arm since it is neadlessly
verbose.
Signed-off-by: james-parky <[email protected]>
Signed-off-by: james-parky <[email protected]>
1d1c2aa to
7cf4af0
Compare
dongsupark
approved these changes
Aug 25, 2025
Member
dongsupark
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.
Looks good, thanks.
Member
|
For some reason code scanning is not running, and that prevents merge, anyway I will by pass and merge. (After merge code scanning anyway ran and passed. https://github.com/flatcar/ue-rs/actions/runs/17204479070) |
dongsupark
added a commit
to flatcar/scripts
that referenced
this pull request
Sep 26, 2025
Pulls in flatcar/ue-rs#72, flatcar/ue-rs#74, flatcar/ue-rs#84, flatcar/ue-rs#85, flatcar/ue-rs#87, flatcar/ue-rs#88. Signed-off-by: Dongsu Park <[email protected]>
dongsupark
added a commit
to flatcar/scripts
that referenced
this pull request
Sep 26, 2025
Pulls in flatcar/ue-rs#72, flatcar/ue-rs#74, flatcar/ue-rs#84, flatcar/ue-rs#85, flatcar/ue-rs#87, flatcar/ue-rs#88. Signed-off-by: Dongsu Park <[email protected]>
dongsupark
added a commit
to flatcar/scripts
that referenced
this pull request
Sep 26, 2025
Pulls in flatcar/ue-rs#72, flatcar/ue-rs#84, flatcar/ue-rs#85, flatcar/ue-rs#87, flatcar/ue-rs#88. Signed-off-by: Dongsu Park <[email protected]>
1 task
dongsupark
added a commit
to flatcar/scripts
that referenced
this pull request
Sep 26, 2025
Pulls in flatcar/ue-rs#72, flatcar/ue-rs#84, flatcar/ue-rs#85, flatcar/ue-rs#87, flatcar/ue-rs#88, flatcar/ue-rs#90. Signed-off-by: Dongsu Park <[email protected]>
dongsupark
added a commit
to flatcar/scripts
that referenced
this pull request
Sep 27, 2025
Pulls in flatcar/ue-rs#72, flatcar/ue-rs#84, flatcar/ue-rs#85, flatcar/ue-rs#87, flatcar/ue-rs#88, flatcar/ue-rs#90. Signed-off-by: Dongsu Park <[email protected]>
dongsupark
added a commit
to flatcar/scripts
that referenced
this pull request
Sep 27, 2025
Pulls in flatcar/ue-rs#72, flatcar/ue-rs#84, flatcar/ue-rs#85, flatcar/ue-rs#87, flatcar/ue-rs#88, flatcar/ue-rs#90. Signed-off-by: Dongsu Park <[email protected]>
dongsupark
added a commit
to flatcar/scripts
that referenced
this pull request
Sep 30, 2025
Pulls in flatcar/ue-rs#72, flatcar/ue-rs#84, flatcar/ue-rs#85, flatcar/ue-rs#87, flatcar/ue-rs#88, flatcar/ue-rs#90. Signed-off-by: Dongsu Park <[email protected]>
sambonbonne
pushed a commit
to sambonbonne/flatcar-scripts
that referenced
this pull request
Oct 3, 2025
Pulls in flatcar/ue-rs#72, flatcar/ue-rs#84, flatcar/ue-rs#85, flatcar/ue-rs#87, flatcar/ue-rs#88, flatcar/ue-rs#90. Signed-off-by: Dongsu Park <[email protected]>
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.
Improvements to the util module
There is currently only one function in the
utilmodule:retry_loop(). This PR improves this function (and therefore module) in that it:retry_loop()as per [Tracking] implement unit tests #77.