Skip to content

Convert impl Condition return signature to Option<bool> #3764

Convert impl Condition return signature to Option<bool>

Convert impl Condition return signature to Option<bool> #3764

Triggered via pull request March 12, 2025 19:09
Status Failure
Total duration 53s
Artifacts

clippy.yml

on: pull_request
clippy_nightly
45s
clippy_nightly
Fit to window
Zoom out
Zoom in

Annotations

4 errors
expected `{[email protected]:242:9}` to return `Option<bool>`, but it returns `bool`: kube-runtime/src/wait.rs#L254
error[E0271]: expected `{[email protected]:242:9}` to return `Option<bool>`, but it returns `bool` --> kube-runtime/src/wait.rs:254:13 | 241 | pub fn is_deployment_completed() -> impl Condition<Deployment> { | -------------------------- closure used here 242 | |obj: Option<&Deployment>| { | -------------------------- | | | _________this closure | | 243 | | if let Some(depl) = &obj { 244 | | if let Some(s) = &depl.status { 245 | | if let Some(conds) = &s.conditions { ... | 254 | | false | | ^^^^^ expected `Option<bool>`, found `bool` 255 | | } | |_________- return type was inferred to be `{closure@kube-runtime/src/wait.rs:242:9: 242:35}` here | = note: expected enum `std::option::Option<bool>` found type `bool` note: required for `{closure@kube-runtime/src/wait.rs:242:9: 242:35}` to implement `wait::Condition<k8s_openapi::api::apps::v1::Deployment>` --> kube-runtime/src/wait.rs:159:44 | 159 | impl<K, F: Fn(Option<&K>) -> Option<bool>> Condition<K> for F { | ------------ ^^^^^^^^^^^^ ^ | | | unsatisfied trait bound introduced here
expected `{[email protected]:261:9}` to return `Option<bool>`, but it returns `bool`: kube-runtime/src/wait.rs#L278
error[E0271]: expected `{[email protected]:261:9}` to return `Option<bool>`, but it returns `bool` --> kube-runtime/src/wait.rs:278:13 | 260 | pub fn is_service_loadbalancer_provisioned() -> impl Condition<Service> { | ----------------------- closure used here 261 | |obj: Option<&Service>| { | ----------------------- | | | _________this closure | | 262 | | if let Some(svc) = &obj { 263 | | // ignore services that are not type LoadBalancer (return true immediately) 264 | | if let Some(spec) = &svc.spec { ... | 278 | | false | | ^^^^^ expected `Option<bool>`, found `bool` 279 | | } | |_________- return type was inferred to be `{closure@kube-runtime/src/wait.rs:261:9: 261:32}` here | = note: expected enum `std::option::Option<bool>` found type `bool` note: required for `{closure@kube-runtime/src/wait.rs:261:9: 261:32}` to implement `wait::Condition<k8s_openapi::api::core::v1::Service>` --> kube-runtime/src/wait.rs:159:44 | 159 | impl<K, F: Fn(Option<&K>) -> Option<bool>> Condition<K> for F { | ------------ ^^^^^^^^^^^^ ^ | | | unsatisfied trait bound introduced here
expected `{[email protected]:285:9}` to return `Option<bool>`, but it returns `bool`: kube-runtime/src/wait.rs#L295
error[E0271]: expected `{[email protected]:285:9}` to return `Option<bool>`, but it returns `bool` --> kube-runtime/src/wait.rs:295:13 | 284 | pub fn is_ingress_provisioned() -> impl Condition<Ingress> { | ----------------------- closure used here 285 | |obj: Option<&Ingress>| { | ----------------------- | | | _________this closure | | 286 | | if let Some(ing) = &obj { 287 | | if let Some(s) = &ing.status { 288 | | if let Some(lbs) = &s.load_balancer { ... | 295 | | false | | ^^^^^ expected `Option<bool>`, found `bool` 296 | | } | |_________- return type was inferred to be `{closure@kube-runtime/src/wait.rs:285:9: 285:32}` here | = note: expected enum `std::option::Option<bool>` found type `bool` note: required for `{closure@kube-runtime/src/wait.rs:285:9: 285:32}` to implement `wait::Condition<k8s_openapi::api::networking::v1::Ingress>` --> kube-runtime/src/wait.rs:159:44 | 159 | impl<K, F: Fn(Option<&K>) -> Option<bool>> Condition<K> for F { | ------------ ^^^^^^^^^^^^ ^ | | | unsatisfied trait bound introduced here
clippy_nightly
Error: Clippy has exited with exit code 101