[pve-devel] [PATCH installer v5 20/36] common: add Display trait to ProxmoxProduct

Aaron Lauterer a.lauterer at proxmox.com
Tue Apr 16 17:33:09 CEST 2024


Signed-off-by: Aaron Lauterer <a.lauterer at proxmox.com>
---
 proxmox-installer-common/src/setup.rs | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/proxmox-installer-common/src/setup.rs b/proxmox-installer-common/src/setup.rs
index 8432a2c..25d0e9e 100644
--- a/proxmox-installer-common/src/setup.rs
+++ b/proxmox-installer-common/src/setup.rs
@@ -38,6 +38,16 @@ impl ProxmoxProduct {
     }
 }
 
+impl fmt::Display for ProxmoxProduct {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        match self {
+            Self::PVE => write!(f, "pve"),
+            Self::PMG => write!(f, "pmg"),
+            Self::PBS => write!(f, "pbs"),
+        }
+    }
+}
+
 #[derive(Clone, Deserialize)]
 pub struct ProductConfig {
     pub fullname: String,
-- 
2.39.2





More information about the pve-devel mailing list