From 2e5384dc6fb7bf979821c779e6d7f82dd9ac282c Mon Sep 17 00:00:00 2001 From: Nick Larsen Date: Fri, 21 Feb 2025 14:30:17 +0100 Subject: [PATCH 1/3] fix(stackable-operator): Improve AwsRegion::name() ergonomics with &self parameter and return `Option<&str>` --- crates/stackable-operator/src/commons/s3/crd.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/stackable-operator/src/commons/s3/crd.rs b/crates/stackable-operator/src/commons/s3/crd.rs index f378a6176..487d3cae1 100644 --- a/crates/stackable-operator/src/commons/s3/crd.rs +++ b/crates/stackable-operator/src/commons/s3/crd.rs @@ -132,7 +132,7 @@ impl AwsRegion { /// }; /// # } /// ``` - pub fn name(self) -> Option { + pub fn name(&self) -> Option<&str> { match self { AwsRegion::Name(name) => Some(name), AwsRegion::Source(_) => None, From 6cff09173d8f6500f4fb44a192e282681f1de584 Mon Sep 17 00:00:00 2001 From: Nick Larsen Date: Fri, 21 Feb 2025 14:36:42 +0100 Subject: [PATCH 2/3] doc(stackable-operator): Update doc --- crates/stackable-operator/src/commons/s3/crd.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/stackable-operator/src/commons/s3/crd.rs b/crates/stackable-operator/src/commons/s3/crd.rs index 487d3cae1..9a451b417 100644 --- a/crates/stackable-operator/src/commons/s3/crd.rs +++ b/crates/stackable-operator/src/commons/s3/crd.rs @@ -124,7 +124,7 @@ impl AwsRegion { /// /// ``` /// # use stackable_operator::commons::s3::AwsRegion; - /// # fn set_property(key: &str, value: String) {} + /// # fn set_property(key: &str, value: &str) {} /// # fn example(aws_region: AwsRegion) { /// if let Some(region_name) = aws_region.name() { /// // set some property if the region is set, or is the default. From b7de40fccfa3746620993fe0484593709d746f49 Mon Sep 17 00:00:00 2001 From: Nick Larsen Date: Fri, 21 Feb 2025 14:34:27 +0100 Subject: [PATCH 3/3] chore(stackable-operator): Update changelog --- crates/stackable-operator/CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/stackable-operator/CHANGELOG.md b/crates/stackable-operator/CHANGELOG.md index 72627a4f4..3f2a273ec 100644 --- a/crates/stackable-operator/CHANGELOG.md +++ b/crates/stackable-operator/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +### Fix + +- BREAKING: Improve `AwsRegion::name()` ergonomics: borrow self and return `Option<&str>` ([#963]). + +[#963]: https://github.com/stackabletech/operator-rs/pull/963 + ## [0.86.1] - 2025-02-21 ### Added