mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-02 05:23:14 +00:00
best address logic
This commit is contained in:
@@ -72,9 +72,7 @@ pub enum IpHostname {
|
||||
},
|
||||
Domain {
|
||||
#[ts(type = "string")]
|
||||
domain: InternedString,
|
||||
#[ts(type = "string | null")]
|
||||
subdomain: Option<InternedString>,
|
||||
value: InternedString,
|
||||
port: Option<u16>,
|
||||
ssl_port: Option<u16>,
|
||||
},
|
||||
@@ -85,15 +83,7 @@ impl IpHostname {
|
||||
Self::Ipv4 { value, .. } => InternedString::from_display(value),
|
||||
Self::Ipv6 { value, .. } => InternedString::from_display(value),
|
||||
Self::Local { value, .. } => value.clone(),
|
||||
Self::Domain {
|
||||
domain, subdomain, ..
|
||||
} => {
|
||||
if let Some(subdomain) = subdomain {
|
||||
InternedString::from_display(&lazy_format!("{subdomain}.{domain}"))
|
||||
} else {
|
||||
domain.clone()
|
||||
}
|
||||
}
|
||||
Self::Domain { value, .. } => value.clone(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user