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 diff --git a/crates/stackable-operator/src/commons/s3/crd.rs b/crates/stackable-operator/src/commons/s3/crd.rs index f378a6176..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. @@ -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,