use std::net::IpAddr;
#[derive(Debug)]
pub struct Default {
pub host: IpAddr,
pub port: u16,
}
impl std::fmt::Display for Default {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(
f,
"{}:{}",
if self.host.is_ipv6() {
format!("[{}]", self.host)
} else {
self.host.to_string()
},
self.port
)
}
}