diff options
| author | Eric Reed <ereed@mozilla.com> | 2013-06-19 15:20:28 -0700 |
|---|---|---|
| committer | Eric Reed <ereed@mozilla.com> | 2013-06-19 15:20:28 -0700 |
| commit | d777ba01cbfc01d1241722e2c27fcd4a4650a300 (patch) | |
| tree | 8984974445323ad647543735167c71300ecd7e35 /src/libstd/rt | |
| parent | 35f3fa6383b5ed278879bfe5c74a913b885a2d4f (diff) | |
| download | rust-d777ba01cbfc01d1241722e2c27fcd4a4650a300.tar.gz rust-d777ba01cbfc01d1241722e2c27fcd4a4650a300.zip | |
Wrote the Eq instance of IpAddr in a slightly different way.
Diffstat (limited to 'src/libstd/rt')
| -rw-r--r-- | src/libstd/rt/io/net/ip.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstd/rt/io/net/ip.rs b/src/libstd/rt/io/net/ip.rs index f885c7f2788..84abc058c33 100644 --- a/src/libstd/rt/io/net/ip.rs +++ b/src/libstd/rt/io/net/ip.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::cmp::{Eq, TotalEq, eq}; +use std::cmp::{Eq, TotalEq}; pub enum IpAddr { Ipv4(u8, u8, u8, u8, u16), @@ -18,13 +18,13 @@ pub enum IpAddr { impl Eq for IpAddr { fn eq(&self, other: &IpAddr) -> bool { match (*self, *other) { - (Ipv4(a,b,c,d,e), Ipv4(f,g,h,i,j)) => a == f && b == g && c == h && d == i && e == j, + (Ipv4(a,b,c,d,e), Ipv4(f,g,h,i,j)) => (a,b,c,d,e) == (f,g,h,i,j), (Ipv6, Ipv6) => fail!(), _ => false } } fn ne(&self, other: &IpAddr) -> bool { - !eq(self, other) + !(self == other) } } |
