From d777ba01cbfc01d1241722e2c27fcd4a4650a300 Mon Sep 17 00:00:00 2001 From: Eric Reed Date: Wed, 19 Jun 2013 15:20:28 -0700 Subject: [PATCH] Wrote the Eq instance of IpAddr in a slightly different way. --- src/libstd/rt/io/net/ip.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libstd/rt/io/net/ip.rs b/src/libstd/rt/io/net/ip.rs index f885c7f27886..84abc058c333 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) } }