Rust 2024 let-chains to simplify wait Conditions #4014
Annotations
3 warnings
|
manual implementation of `.is_multiple_of()`:
kube-client/src/api/portforward.rs#L304
warning: manual implementation of `.is_multiple_of()`
--> kube-client/src/api/portforward.rs:304:20
|
304 | if ch % 2 != 0 {
| ^^^^^^^^^^^ help: replace with: `!ch.is_multiple_of(2)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of
= note: `#[warn(clippy::manual_is_multiple_of)]` on by default
|
|
this `if` statement can be collapsed:
kube-core/src/cel.rs#L279
warning: this `if` statement can be collapsed
--> kube-core/src/cel.rs:279:5
|
279 | / if let Some(properties) = s
280 | | .ensure_object()
281 | | .entry("properties")
282 | | .or_insert(serde_json::Value::Object(Default::default()))
... |
295 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
help: collapse nested if block
|
283 ~ .as_object_mut()
284 ~ && let Some(merge_properties) = merge
285 | .ensure_object()
...
292 | }
293 ~ }
|
|
|
this `if` statement can be collapsed:
kube-core/src/discovery.rs#L133
warning: this `if` statement can be collapsed
--> kube-core/src/discovery.rs:133:5
|
133 | / if word.ends_with('y') {
134 | | if let Some(c) = word.chars().nth(word.len() - 2)
135 | | && !matches!(c, 'a' | 'e' | 'i' | 'o' | 'u')
... |
142 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
= note: `#[warn(clippy::collapsible_if)]` on by default
help: collapse nested if block
|
133 ~ if word.ends_with('y')
134 ~ && let Some(c) = word.chars().nth(word.len() - 2)
135 | && !matches!(c, 'a' | 'e' | 'i' | 'o' | 'u')
...
140 | return format!("{}ies", chars.as_str());
141 ~ }
|
|