Skip to content

Commit

Permalink
Stop using from_ne_bytes to be compatible with Rust < 1.32.0
Browse files Browse the repository at this point in the history
  • Loading branch information
faern committed Nov 27, 2020
1 parent 3e217e3 commit ca8db53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ fn socket_addr_to_ptrs(addr: &SocketAddr) -> (SocketAddrCRepr, c_int) {
let sockaddr_in = SOCKADDR_IN {
sin_family: AF_INET as ADDRESS_FAMILY,
sin_port: a.port().to_be(),
sin_addr: IN_ADDR { S_un: u32::from_ne_bytes(a.ip().octets()) },
sin_addr: IN_ADDR { S_un: u32::from(*a.ip()).to_be() },
sin_zero: [0; 8],
};

Expand Down

0 comments on commit ca8db53

Please sign in to comment.