diff options
| author | Brendan Zabarauskas <bjzaba@yahoo.com.au> | 2014-06-16 11:25:47 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-06-18 17:01:34 -0700 |
| commit | ff9f92ce5224f5e27b8dc39ffc02eb9481f7cff1 (patch) | |
| tree | f56ac5a3288101c49c4cc5c2e85b18dd4c2c6ff7 /src/librustuv | |
| parent | 4c0f8f49f6fe860efa268efa2f4fa0b5f00a4b07 (diff) | |
| download | rust-ff9f92ce5224f5e27b8dc39ffc02eb9481f7cff1.tar.gz rust-ff9f92ce5224f5e27b8dc39ffc02eb9481f7cff1.zip | |
Merge the Bitwise and ByteOrder traits into the Int trait
This reduces the complexity of the trait hierarchy.
Diffstat (limited to 'src/librustuv')
| -rw-r--r-- | src/librustuv/net.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/librustuv/net.rs b/src/librustuv/net.rs index 83beeceb8de..aa7fab2565d 100644 --- a/src/librustuv/net.rs +++ b/src/librustuv/net.rs @@ -11,7 +11,6 @@ use libc::{size_t, ssize_t, c_int, c_void, c_uint}; use libc; use std::mem; -use std::mem::ByteOrder; use std::ptr; use std::rt::rtio; use std::rt::rtio::IoError; @@ -32,7 +31,7 @@ use uvll; //////////////////////////////////////////////////////////////////////////////// pub fn htons(u: u16) -> u16 { u.to_big_endian() } -pub fn ntohs(u: u16) -> u16 { ByteOrder::from_big_endian(u) } +pub fn ntohs(u: u16) -> u16 { Int::from_big_endian(u) } pub fn sockaddr_to_addr(storage: &libc::sockaddr_storage, len: uint) -> rtio::SocketAddr { @@ -90,7 +89,7 @@ fn addr_to_sockaddr(addr: rtio::SocketAddr) -> (libc::sockaddr_storage, uint) { (*storage).sin_family = libc::AF_INET as libc::sa_family_t; (*storage).sin_port = htons(addr.port); (*storage).sin_addr = libc::in_addr { - s_addr: ByteOrder::from_big_endian(ip), + s_addr: Int::from_big_endian(ip), }; mem::size_of::<libc::sockaddr_in>() |
