Skip to content

Commit bf80520

Browse files
authored
fix(v2): Don't require macro callers to have std::str::FromStr in scope (#1244)
* fix(v2): Don't require macro callers to have `std::str::FromStr` in scope * changelog * changelog * changelog
1 parent e58dcb0 commit bf80520

5 files changed

Lines changed: 9 additions & 10 deletions

File tree

crates/stackable-operator/CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,17 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
### Fixed
8+
9+
- [v2] Don't require the `attributed_string_type` macro caller to have `std::str::FromStr` in scope ([#1244]).
10+
11+
[#1244]: https://github.com/stackabletech/operator-rs/pull/1244
12+
713
## [0.113.2] - 2026-07-07
814

915
### Added
1016

11-
- Add `raw_object_schema` to v2 `JsonConfigOverrides` ([#1242]).
17+
- [v2] Add `raw_object_schema` to `JsonConfigOverrides` ([#1242]).
1218

1319
[#1242]: https://github.com/stackabletech/operator-rs/pull/1242
1420

crates/stackable-operator/src/v2/builder/pod/container.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
use std::{
2-
collections::{BTreeMap, btree_map},
3-
str::FromStr,
4-
};
1+
use std::collections::{BTreeMap, btree_map};
52

63
use snafu::Snafu;
74
use strum::{EnumDiscriminants, IntoStaticStr};

crates/stackable-operator/src/v2/macros/attributed_string_type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ macro_rules! attributed_string_type {
150150
D: serde::Deserializer<'de>,
151151
{
152152
let string: String = serde::Deserialize::deserialize(deserializer)?;
153-
$name::from_str(&string).map_err(|err| serde::de::Error::custom(&err))
153+
<$name as std::str::FromStr>::from_str(&string).map_err(|err| serde::de::Error::custom(&err))
154154
}
155155
}
156156

crates/stackable-operator/src/v2/types/kubernetes.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
//! Kubernetes (resource) names
2-
use std::str::FromStr;
3-
42
use crate::{
53
attributed_string_type,
64
validation::{RFC_1123_LABEL_MAX_LENGTH, RFC_1123_SUBDOMAIN_MAX_LENGTH},

crates/stackable-operator/src/v2/types/operator.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//! Names for operators
22
3-
use std::str::FromStr;
4-
53
use crate::attributed_string_type;
64

75
attributed_string_type! {

0 commit comments

Comments
 (0)