diff options
| author | bors <bors@rust-lang.org> | 2020-06-16 14:58:14 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-06-16 14:58:14 +0000 |
| commit | a647c0cd68bdd0f15081019f0b21bc31ae23f072 (patch) | |
| tree | 2e5ec96c4bbeedd4a6951c61505e2dd517037b21 /src/libstd/sys | |
| parent | 435f97cec1f0d7de95a0b80e95f295ab444b2fce (diff) | |
| parent | b4dd6a0dc43f85d9fcd9cfaf45a5c5d854ee13ae (diff) | |
| download | rust-a647c0cd68bdd0f15081019f0b21bc31ae23f072.tar.gz rust-a647c0cd68bdd0f15081019f0b21bc31ae23f072.zip | |
Auto merge of #73402 - Dylan-DPC:rollup-8udzpfu, r=Dylan-DPC
Rollup of 8 pull requests Successful merges: - #73237 (Check for overflow in DroplessArena and align returned memory) - #73339 (Don't run generator transform when there's a TyErr) - #73372 (Re-order correctly the sections in the sidebar) - #73373 (Use track caller for bug! macro) - #73380 (Add more info to `x.py build --help` on default value for `-j JOBS`.) - #73381 (Fix typo in docs of std::mem) - #73389 (Use `Ipv4Addr::from<[u8; 4]>` when possible) - #73400 (Fix forge-platform-support URL) Failed merges: r? @ghost
Diffstat (limited to 'src/libstd/sys')
| -rw-r--r-- | src/libstd/sys/hermit/net.rs | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/libstd/sys/hermit/net.rs b/src/libstd/sys/hermit/net.rs index 9e588c4265a..8a788a9265f 100644 --- a/src/libstd/sys/hermit/net.rs +++ b/src/libstd/sys/hermit/net.rs @@ -147,10 +147,7 @@ impl TcpStream { .map_err(|_| io::Error::new(ErrorKind::Other, "peer_addr failed"))?; let saddr = match ipaddr { - Ipv4(ref addr) => SocketAddr::new( - IpAddr::V4(Ipv4Addr::new(addr.0[0], addr.0[1], addr.0[2], addr.0[3])), - port, - ), + Ipv4(ref addr) => SocketAddr::new(IpAddr::V4(Ipv4Addr::from(addr.0)), port), Ipv6(ref addr) => SocketAddr::new(IpAddr::V6(Ipv6Addr::from(addr.0)), port), _ => { return Err(io::Error::new(ErrorKind::Other, "peer_addr failed")); @@ -227,10 +224,7 @@ impl TcpListener { let (handle, ipaddr, port) = abi::tcplistener::accept(self.0.port()) .map_err(|_| io::Error::new(ErrorKind::Other, "accept failed"))?; let saddr = match ipaddr { - Ipv4(ref addr) => SocketAddr::new( - IpAddr::V4(Ipv4Addr::new(addr.0[0], addr.0[1], addr.0[2], addr.0[3])), - port, - ), + Ipv4(ref addr) => SocketAddr::new(IpAddr::V4(Ipv4Addr::from(addr.0)), port), Ipv6(ref addr) => SocketAddr::new(IpAddr::V6(Ipv6Addr::from(addr.0)), port), _ => { return Err(io::Error::new(ErrorKind::Other, "accept failed")); |
