changes to pass the format check

This commit is contained in:
Stefan Lankes 2020-06-15 07:28:53 +02:00
parent d221ffc68e
commit 9d596b50f1

View File

@ -149,13 +149,10 @@ impl TcpStream {
IpAddr::V4(Ipv4Addr::new(addr.0[0], addr.0[1], addr.0[2], addr.0[3])),
port,
),
Ipv6(ref addr) => SocketAddr::new(
IpAddr::V6(Ipv6Addr::new(addr.0)),
port,
),
Ipv6(ref addr) => SocketAddr::new(IpAddr::V6(Ipv6Addr::new(addr.0)), port),
_ => {
return Err(io::Error::new(ErrorKind::Other, "peer_addr failed"));
},
}
};
Ok(saddr)
@ -232,13 +229,10 @@ impl TcpListener {
IpAddr::V4(Ipv4Addr::new(addr.0[0], addr.0[1], addr.0[2], addr.0[3])),
port,
),
Ipv6(ref addr) => SocketAddr::new(
IpAddr::V6(Ipv6Addr::new(addr.0)),
port,
),
Ipv6(ref addr) => SocketAddr::new(IpAddr::V6(Ipv6Addr::new(addr.0)), port),
_ => {
return Err(io::Error::new(ErrorKind::Other, "accept failed"));
},
}
};
Ok((TcpStream(Arc::new(Socket(handle))), saddr))