Rust 2024 let-chains to simplify wait Conditions#1792
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1792 +/- ##
=======================================
- Coverage 74.7% 74.7% -0.0%
=======================================
Files 84 84
Lines 7951 7950 -1
=======================================
- Hits 5939 5937 -2
- Misses 2012 2013 +1
🚀 New features to boost your workflow:
|
started out as a PR to try out let-chains, but found that it solves the ergonomic problem with the wait API that I tried to solve earlier in #1498 Signed-off-by: clux <sszynrae@gmail.com>
d9571ab to
f42dfcc
Compare
Signed-off-by: clux <sszynrae@gmail.com>
Signed-off-by: clux <sszynrae@gmail.com>
Signed-off-by: clux <sszynrae@gmail.com>
Signed-off-by: clux <sszynrae@gmail.com>
Signed-off-by: clux <sszynrae@gmail.com>
clux
commented
Dec 10, 2025
kube-core/src/params.rs
Outdated
Comment on lines
111
to
118
| match &self.version_match { | ||
| None => {} | ||
| Some(VersionMatch::NotOlderThan) => { | ||
| qp.append_pair("resourceVersionMatch", "NotOlderThan"); | ||
| } | ||
| Some(VersionMatch::Exact) => { | ||
| qp.append_pair("resourceVersionMatch", "Exact"); | ||
| } |
Member
Author
There was a problem hiding this comment.
could technically be
Suggested change
| match &self.version_match { | |
| None => {} | |
| Some(VersionMatch::NotOlderThan) => { | |
| qp.append_pair("resourceVersionMatch", "NotOlderThan"); | |
| } | |
| Some(VersionMatch::Exact) => { | |
| qp.append_pair("resourceVersionMatch", "Exact"); | |
| } | |
| if let Some(vm) = &self.version_match { | |
| qp.append_pair("resourceVersionMatch", &format!("{:?}", vm)); | |
| } |
but not sure it's better. feels it drops some readability, and don't like relying on debug print.
Danil-Grigorev
approved these changes
Dec 10, 2025
Member
Danil-Grigorev
left a comment
There was a problem hiding this comment.
One suggestion, otherwise looks good.
Signed-off-by: clux <sszynrae@gmail.com>
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.
Bumps MSRV to 1.88.0 and converts existing let-chainable code to use let-chains. Rust 2024 support was added in separately in #1856, and we can use it properly now since 1.88 is like 3 versions behind.
Was originally playing around with it, but actually found that it solves most of the the ergonomic problem with the wait API that I tried to solve earlier in #1498 - it's not quite as elegant but it also doesn't come with any of the problems and is non-breaking.
But if the general setup (outlined in the first commit) is acceptable, I'll rebase at 1.90.Waiting for #1856 to merge.Now ready.