diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2014-02-23 21:29:35 +1100 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2014-02-24 07:44:10 +1100 |
| commit | efaf4db24c92e119e26dc575ffd6bfd3b91fb87d (patch) | |
| tree | e735230061b0c480550fdaad749a998bc48df78d /src/libstd/io | |
| parent | 5444da54fd32b705eec28112e309f63b704e3f8c (diff) | |
| download | rust-efaf4db24c92e119e26dc575ffd6bfd3b91fb87d.tar.gz rust-efaf4db24c92e119e26dc575ffd6bfd3b91fb87d.zip | |
Transition to new `Hash`, removing IterBytes and std::to_bytes.
Diffstat (limited to 'src/libstd/io')
| -rw-r--r-- | src/libstd/io/net/ip.rs | 16 | ||||
| -rw-r--r-- | src/libstd/io/signal.rs | 2 |
2 files changed, 3 insertions, 15 deletions
diff --git a/src/libstd/io/net/ip.rs b/src/libstd/io/net/ip.rs index f042661117e..13ea552ab3b 100644 --- a/src/libstd/io/net/ip.rs +++ b/src/libstd/io/net/ip.rs @@ -14,12 +14,11 @@ use iter::Iterator; use option::{Option, None, Some}; use str::StrSlice; use to_str::ToStr; -use to_bytes::IterBytes; use vec::{MutableCloneableVector, ImmutableVector, MutableVector}; pub type Port = u16; -#[deriving(Eq, TotalEq, Clone, IterBytes)] +#[deriving(Eq, TotalEq, Clone, Hash)] pub enum IpAddr { Ipv4Addr(u8, u8, u8, u8), Ipv6Addr(u16, u16, u16, u16, u16, u16, u16, u16) @@ -49,7 +48,7 @@ impl ToStr for IpAddr { } } -#[deriving(Eq, TotalEq, Clone, IterBytes)] +#[deriving(Eq, TotalEq, Clone, Hash)] pub struct SocketAddr { ip: IpAddr, port: Port, @@ -340,7 +339,6 @@ impl FromStr for SocketAddr { mod test { use prelude::*; use super::*; - use to_bytes::ToBytes; #[test] fn test_from_str_ipv4() { @@ -442,14 +440,4 @@ mod test { assert!(a1.to_str() == ~"::ffff:192.0.2.128" || a1.to_str() == ~"::FFFF:192.0.2.128"); assert_eq!(Ipv6Addr(8, 9, 10, 11, 12, 13, 14, 15).to_str(), ~"8:9:a:b:c:d:e:f"); } - - #[test] - fn ipv4_addr_to_bytes() { - Ipv4Addr(123, 20, 12, 56).to_bytes(true); - } - - #[test] - fn socket_addr_to_bytes() { - SocketAddr { ip: Ipv4Addr(1, 2, 3, 4), port: 1234 }.to_bytes(true); - } } diff --git a/src/libstd/io/signal.rs b/src/libstd/io/signal.rs index 19aff4f70fe..32670fa7c2c 100644 --- a/src/libstd/io/signal.rs +++ b/src/libstd/io/signal.rs @@ -30,7 +30,7 @@ use rt::rtio::{IoFactory, LocalIo, RtioSignal}; use vec::{ImmutableVector, OwnedVector}; #[repr(int)] -#[deriving(Eq, IterBytes)] +#[deriving(Eq, Hash)] pub enum Signum { /// Equivalent to SIGBREAK, delivered when the user presses Ctrl-Break. Break = 21i, |
