Skip to content

Commit d777ba0

Browse files
author
Eric Reed
committed
Wrote the Eq instance of IpAddr in a slightly different way.
1 parent 35f3fa6 commit d777ba0

File tree

1 file changed

+3
-3
lines changed
  • src/libstd/rt/io/net

1 file changed

+3
-3
lines changed

src/libstd/rt/io/net/ip.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use std::cmp::{Eq, TotalEq, eq};
11+
use std::cmp::{Eq, TotalEq};
1212

1313
pub enum IpAddr {
1414
Ipv4(u8, u8, u8, u8, u16),
@@ -18,13 +18,13 @@ pub enum IpAddr {
1818
impl Eq for IpAddr {
1919
fn eq(&self, other: &IpAddr) -> bool {
2020
match (*self, *other) {
21-
(Ipv4(a,b,c,d,e), Ipv4(f,g,h,i,j)) => a == f && b == g && c == h && d == i && e == j,
21+
(Ipv4(a,b,c,d,e), Ipv4(f,g,h,i,j)) => (a,b,c,d,e) == (f,g,h,i,j),
2222
(Ipv6, Ipv6) => fail!(),
2323
_ => false
2424
}
2525
}
2626
fn ne(&self, other: &IpAddr) -> bool {
27-
!eq(self, other)
27+
!(self == other)
2828
}
2929
}
3030

0 commit comments

Comments
 (0)