[pdm-devel] [PATCH proxmox v2 4/4] pve-api-types: sdn: handle fallback variant
Stefan Hanreich
s.hanreich at proxmox.com
Thu Nov 13 16:09:28 CET 2025
Add the fallback variant to as_str. The only current callers of this
method don't require 'static lifetime, so it is safe to remove here.
Signed-off-by: Stefan Hanreich <s.hanreich at proxmox.com>
---
pve-api-types/src/sdn.rs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pve-api-types/src/sdn.rs b/pve-api-types/src/sdn.rs
index 8188c35f..97972275 100644
--- a/pve-api-types/src/sdn.rs
+++ b/pve-api-types/src/sdn.rs
@@ -33,10 +33,11 @@ impl SdnController {
}
impl ClusterResourceNetworkType {
- pub fn as_str(&self) -> &'static str {
+ pub fn as_str(&self) -> &str {
match self {
ClusterResourceNetworkType::Fabric => "fabric",
ClusterResourceNetworkType::Zone => "zone",
+ ClusterResourceNetworkType::UnknownEnumValue(value) => value.as_str(),
}
}
}
--
2.47.3
More information about the pdm-devel
mailing list