From 46fd0176c1d6472736721b4b5d929449b579cbc1 Mon Sep 17 00:00:00 2001 From: Saul Beck Date: Mon, 1 Jun 2026 14:56:23 +0100 Subject: [PATCH] chore: bump Rust edition to 2024 and apply cargo fix + clippy updates Run `cargo fix --edition` and resolve resulting warnings: - Add `use<>` syntax to `impl Trait` return types (auto-fixed) - Fix Rust 2024 temporary drop order change by simplifying `_initial_reconcile_rx` handling - Apply Clippy suggestions - Use `&& let` chaining instead of nested `if let` - Remove unnecessary nesting introduced by refactor --- Cargo.nix | 2 +- Cargo.toml | 2 +- rust/operator-binary/src/command.rs | 16 ++++++++-------- rust/operator-binary/src/controller.rs | 12 ++++++------ rust/operator-binary/src/webhooks/conversion.rs | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Cargo.nix b/Cargo.nix index cb47a36c..9749ca6d 100644 --- a/Cargo.nix +++ b/Cargo.nix @@ -9640,7 +9640,7 @@ rec { "stackable-hive-operator" = rec { crateName = "stackable-hive-operator"; version = "0.0.0-dev"; - edition = "2021"; + edition = "2024"; crateBin = [ { name = "stackable-hive-operator"; diff --git a/Cargo.toml b/Cargo.toml index ec6d3e67..4afe66ac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ resolver = "2" version = "0.0.0-dev" authors = ["Stackable GmbH "] license = "OSL-3.0" -edition = "2021" +edition = "2024" repository = "https://github.com/stackabletech/hive-operator" [workspace.dependencies] diff --git a/rust/operator-binary/src/command.rs b/rust/operator-binary/src/command.rs index 0ce91957..086e833f 100644 --- a/rust/operator-binary/src/command.rs +++ b/rust/operator-binary/src/command.rs @@ -46,20 +46,20 @@ pub fn build_container_command_args( ]); } - if let Some(s3) = s3_connection_spec { - if let Some(ca_cert_file) = s3.tls.tls_ca_cert_mount_path() { - args.push(format!( + if let Some(s3) = s3_connection_spec + && let Some(ca_cert_file) = s3.tls.tls_ca_cert_mount_path() + { + args.push(format!( "cert-tools generate-pkcs12-truststore --pkcs12 {STACKABLE_TRUST_STORE}:{STACKABLE_TRUST_STORE_PASSWORD} --pem {ca_cert_file} --out {STACKABLE_TRUST_STORE} --out-password {STACKABLE_TRUST_STORE_PASSWORD}" )); - } } - if let Some(opa) = hive_opa_config { - if let Some(ca_cert_dir) = opa.tls_ca_cert_mount_path() { - args.push(format!( + if let Some(opa) = hive_opa_config + && let Some(ca_cert_dir) = opa.tls_ca_cert_mount_path() + { + args.push(format!( "cert-tools generate-pkcs12-truststore --pkcs12 {STACKABLE_TRUST_STORE}:{STACKABLE_TRUST_STORE_PASSWORD} --pem {ca_cert_dir}/ca.crt --out {STACKABLE_TRUST_STORE} --out-password {STACKABLE_TRUST_STORE_PASSWORD}" )); - } } // metastore start command diff --git a/rust/operator-binary/src/controller.rs b/rust/operator-binary/src/controller.rs index 6fc44f07..636d97b3 100644 --- a/rust/operator-binary/src/controller.rs +++ b/rust/operator-binary/src/controller.rs @@ -942,12 +942,12 @@ fn build_metastore_rolegroup_statefulset( // TODO: refactor this when CRD versioning is in place // Warn if the capacity field has been set to anything other than 0Mi - if let Some(Quantity(capacity)) = merged_config.resources.storage.data.capacity.as_ref() { - if capacity != &"0Mi".to_string() { - tracing::warn!( - "The 'storage' CRD property is set to [{capacity}]. This field is not used and will be removed in a future release." - ); - } + if let Some(Quantity(capacity)) = merged_config.resources.storage.data.capacity.as_ref() + && capacity != &"0Mi".to_string() + { + tracing::warn!( + "The 'storage' CRD property is set to [{capacity}]. This field is not used and will be removed in a future release." + ); } let recommended_object_labels = build_recommended_labels( diff --git a/rust/operator-binary/src/webhooks/conversion.rs b/rust/operator-binary/src/webhooks/conversion.rs index 1d5acc7e..cf27f3f8 100644 --- a/rust/operator-binary/src/webhooks/conversion.rs +++ b/rust/operator-binary/src/webhooks/conversion.rs @@ -37,7 +37,7 @@ pub async fn create_webhook_server( field_manager: FIELD_MANAGER.to_owned(), }; - let (conversion_webhook, _initial_reconcile_rx) = + let (conversion_webhook, _) = ConversionWebhook::new(crds_and_handlers, client, conversion_webhook_options); let webhook_server_options = WebhookServerOptions {