Skip to content

Commit 1bd2f09

Browse files
authored
fix(stackable-operator): Improve AwsRegion::name() ergonomics (#963)
* fix(stackable-operator): Improve AwsRegion::name() ergonomics with &self parameter and return `Option<&str>` * doc(stackable-operator): Update doc * chore(stackable-operator): Update changelog
1 parent 93004e1 commit 1bd2f09

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

crates/stackable-operator/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
### Fix
8+
9+
- BREAKING: Improve `AwsRegion::name()` ergonomics: borrow self and return `Option<&str>` ([#963]).
10+
11+
[#963]: https://github.com/stackabletech/operator-rs/pull/963
12+
713
## [0.86.1] - 2025-02-21
814

915
### Added

crates/stackable-operator/src/commons/s3/crd.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,15 @@ impl AwsRegion {
124124
///
125125
/// ```
126126
/// # use stackable_operator::commons::s3::AwsRegion;
127-
/// # fn set_property(key: &str, value: String) {}
127+
/// # fn set_property(key: &str, value: &str) {}
128128
/// # fn example(aws_region: AwsRegion) {
129129
/// if let Some(region_name) = aws_region.name() {
130130
/// // set some property if the region is set, or is the default.
131131
/// set_property("aws.region", region_name);
132132
/// };
133133
/// # }
134134
/// ```
135-
pub fn name(self) -> Option<String> {
135+
pub fn name(&self) -> Option<&str> {
136136
match self {
137137
AwsRegion::Name(name) => Some(name),
138138
AwsRegion::Source(_) => None,

0 commit comments

Comments
 (0)