Revert "changes to pass the format check"

This reverts commit 9d596b50f1.
This commit is contained in:
Stefan Lankes 2020-06-15 08:43:08 +02:00
parent 810ba39563
commit aa53a037a2

View File

@ -148,10 +148,13 @@ pub fn peer_addr(&self) -> io::Result<SocketAddr> {
IpAddr::V4(Ipv4Addr::new(addr.0[0], addr.0[1], addr.0[2], addr.0[3])), IpAddr::V4(Ipv4Addr::new(addr.0[0], addr.0[1], addr.0[2], addr.0[3])),
port, 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")); return Err(io::Error::new(ErrorKind::Other, "peer_addr failed"));
} },
}; };
Ok(saddr) Ok(saddr)
@ -228,10 +231,13 @@ pub fn accept(&self) -> io::Result<(TcpStream, SocketAddr)> {
IpAddr::V4(Ipv4Addr::new(addr.0[0], addr.0[1], addr.0[2], addr.0[3])), IpAddr::V4(Ipv4Addr::new(addr.0[0], addr.0[1], addr.0[2], addr.0[3])),
port, 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")); return Err(io::Error::new(ErrorKind::Other, "accept failed"));
} },
}; };
Ok((TcpStream(Arc::new(Socket(handle))), saddr)) Ok((TcpStream(Arc::new(Socket(handle))), saddr))