]> git.proxmox.com Git - pve-installer.git/commitdiff
tui: do not fail completely on invalid domain names
authorChristoph Heiss <c.heiss@proxmox.com>
Wed, 21 Jun 2023 09:40:44 +0000 (11:40 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 21 Jun 2023 13:09:06 +0000 (15:09 +0200)
Since we already handly non-present domain names, invalid names can be
handled the same way, as not to completely fail the installation.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
proxmox-tui-installer/src/setup.rs

index 43e4b0d8ed02198e5c756bba20a5d17c2ffce6fb..191976b306c691cb8c12d7bd996137895aba598f 100644 (file)
@@ -405,3 +405,11 @@ where
 {
     Ok(Deserialize::deserialize(deserializer).ok())
 }
+
+fn deserialize_invalid_value_as_none<'de, D, T>(deserializer: D) -> Result<Option<T>, D::Error>
+where
+    D: Deserializer<'de>,
+    T: Deserialize<'de>,
+{
+    Ok(Deserialize::deserialize(deserializer).ok())
+}