From ff9f92ce5224f5e27b8dc39ffc02eb9481f7cff1 Mon Sep 17 00:00:00 2001 From: Brendan Zabarauskas Date: Mon, 16 Jun 2014 11:25:47 -0700 Subject: Merge the Bitwise and ByteOrder traits into the Int trait This reduces the complexity of the trait hierarchy. --- src/libnative/io/net.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/libnative') diff --git a/src/libnative/io/net.rs b/src/libnative/io/net.rs index f0cd2d966cb..23fd607aafe 100644 --- a/src/libnative/io/net.rs +++ b/src/libnative/io/net.rs @@ -11,7 +11,6 @@ use alloc::arc::Arc; use libc; use std::mem; -use std::mem::ByteOrder; use std::rt::mutex; use std::rt::rtio; use std::rt::rtio::{IoResult, IoError}; @@ -31,7 +30,7 @@ pub fn htons(u: u16) -> u16 { u.to_big_endian() } pub fn ntohs(u: u16) -> u16 { - ByteOrder::from_big_endian(u) + Int::from_big_endian(u) } enum InAddr { @@ -47,7 +46,7 @@ fn ip_to_inaddr(ip: rtio::IpAddr) -> InAddr { (c as u32 << 8) | (d as u32 << 0); InAddr(libc::in_addr { - s_addr: ByteOrder::from_big_endian(ip) + s_addr: Int::from_big_endian(ip) }) } rtio::Ipv6Addr(a, b, c, d, e, f, g, h) => { -- cgit 1.4.1-3-g733a5