]> git.proxmox.com Git - pve-installer.git/commitdiff
tui: use `IpAddr` type for deserializing ip addresses directly
authorChristoph Heiss <c.heiss@proxmox.com>
Tue, 20 Jun 2023 07:00:12 +0000 (09:00 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 20 Jun 2023 09:09:39 +0000 (11:09 +0200)
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
proxmox-tui-installer/src/options.rs
proxmox-tui-installer/src/setup.rs

index 1ba41ea3ef90d439dafe1c4742f16af9187eae9a..2a00ec37f7652b5396ee02d75c0b26d30f157541 100644 (file)
@@ -322,9 +322,7 @@ impl From<&NetworkInfo> for NetworkOptions {
         let mut this = Self::default();
 
         if let Some(ip) = info.dns.dns.first() {
-            if let Ok(ip) = ip.parse() {
-                this.dns_server = ip;
-            }
+            this.dns_server = *ip;
         }
 
         if let Some(domain) = info.dns.domain.as_deref() {
index 6808a1dcb9c95cd344c50612665c52a201611be7..148f81c9fea7b1b6f073c63c47c3b329b5ccbd04 100644 (file)
@@ -261,7 +261,7 @@ pub struct Dns {
 
     /// List of stringified IP addresses.
     #[serde(default)]
-    pub dns: Vec<String>,
+    pub dns: Vec<IpAddr>,
 }
 
 #[derive(Clone, Deserialize)]