From f12ff1964b3040c426263d52472a9ed503c6a4aa Mon Sep 17 00:00:00 2001 From: Erick Tryzelaar Date: Sun, 23 Feb 2014 17:45:44 -0800 Subject: std: minor whitespace cleanup --- src/libstd/io/net/ip.rs | 1 - src/libstd/lib.rs | 1 - 2 files changed, 2 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/io/net/ip.rs b/src/libstd/io/net/ip.rs index e4f36764323..e29aa5e5ed1 100644 --- a/src/libstd/io/net/ip.rs +++ b/src/libstd/io/net/ip.rs @@ -55,7 +55,6 @@ pub struct SocketAddr { port: Port, } - impl fmt::Show for SocketAddr { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self.ip { diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index d7fc85bc259..83d2ce53444 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -149,7 +149,6 @@ pub mod container; pub mod default; pub mod any; - /* Common data structures */ pub mod option; -- cgit 1.4.1-3-g733a5 From 848cbb4e130d7ec9609b36b3f6f7a68099cbd6a7 Mon Sep 17 00:00:00 2001 From: Erick Tryzelaar Date: Sun, 23 Feb 2014 18:50:47 -0800 Subject: replace manual Hash impls with `#[deriving(Hash)]` --- src/libstd/ascii.rs | 10 +--------- src/libsyntax/abi.rs | 9 +-------- 2 files changed, 2 insertions(+), 17 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/ascii.rs b/src/libstd/ascii.rs index ac24a02c15b..d7b6ab25078 100644 --- a/src/libstd/ascii.rs +++ b/src/libstd/ascii.rs @@ -18,13 +18,12 @@ use str::OwnedStr; use container::Container; use cast; use fmt; -use hash::{Hash, sip}; use iter::Iterator; use vec::{ImmutableVector, MutableVector, Vector}; use option::{Option, Some, None}; /// Datatype to hold one ascii character. It wraps a `u8`, with the highest bit always zero. -#[deriving(Clone, Eq, Ord, TotalOrd, TotalEq)] +#[deriving(Clone, Eq, Ord, TotalOrd, TotalEq, Hash)] pub struct Ascii { priv chr: u8 } impl Ascii { @@ -306,13 +305,6 @@ impl IntoStr for ~[Ascii] { } } -impl Hash for Ascii { - #[inline] - fn hash(&self, s: &mut sip::SipState) { - self.to_byte().hash(s) - } -} - /// Trait to convert to an owned byte array by consuming self pub trait IntoBytes { /// Converts to an owned byte array by consuming self diff --git a/src/libsyntax/abi.rs b/src/libsyntax/abi.rs index 9349e5c8e98..c01f3721fad 100644 --- a/src/libsyntax/abi.rs +++ b/src/libsyntax/abi.rs @@ -8,14 +8,13 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::hash::{Hash, sip}; use std::fmt; use std::fmt::Show; #[deriving(Eq)] pub enum Os { OsWin32, OsMacos, OsLinux, OsAndroid, OsFreebsd, } -#[deriving(Eq)] +#[deriving(Eq, Hash)] pub enum Abi { // NB: This ordering MUST match the AbiDatas array below. // (This is ensured by the test indices_are_correct().) @@ -267,12 +266,6 @@ impl AbiSet { } } -impl Hash for Abi { - fn hash(&self, s: &mut sip::SipState) { - self.index().hash(s) - } -} - impl fmt::Show for Abi { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.data().name.fmt(f) -- cgit 1.4.1-3-g733a5