From bba701c59d84eac4e20d0796ec06db8d1cdd39cf Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Sat, 31 May 2014 10:43:52 -0700 Subject: std: Drop Total from Total{Eq,Ord} This completes the last stage of the renaming of the comparison hierarchy of traits. This change renames TotalEq to Eq and TotalOrd to Ord. In the future the new Eq/Ord will be filled out with their appropriate methods, but for now this change is purely a renaming change. [breaking-change] --- src/libstd/ascii.rs | 2 +- src/libstd/bitflags.rs | 2 +- src/libstd/io/net/ip.rs | 4 ++-- src/libstd/io/process.rs | 4 ++-- src/libstd/path/posix.rs | 4 ++-- src/libstd/path/windows.rs | 4 ++-- src/libstd/prelude.rs | 6 +++--- src/libstd/slice.rs | 10 +++++----- src/libstd/str.rs | 6 +++--- src/libstd/string.rs | 2 +- src/libstd/vec.rs | 10 +++++----- 11 files changed, 27 insertions(+), 27 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/ascii.rs b/src/libstd/ascii.rs index 222297aaf0e..e9bb23a75c8 100644 --- a/src/libstd/ascii.rs +++ b/src/libstd/ascii.rs @@ -23,7 +23,7 @@ use to_str::{IntoStr}; use vec::Vec; /// Datatype to hold one ascii character. It wraps a `u8`, with the highest bit always zero. -#[deriving(Clone, PartialEq, PartialOrd, TotalOrd, TotalEq, Hash)] +#[deriving(Clone, PartialEq, PartialOrd, Ord, Eq, Hash)] pub struct Ascii { chr: u8 } impl Ascii { diff --git a/src/libstd/bitflags.rs b/src/libstd/bitflags.rs index eb8c7e7d283..7d821983075 100644 --- a/src/libstd/bitflags.rs +++ b/src/libstd/bitflags.rs @@ -112,7 +112,7 @@ macro_rules! bitflags( ($(#[$attr:meta])* flags $BitFlags:ident: $T:ty { $($(#[$Flag_attr:meta])* static $Flag:ident = $value:expr),+ }) => ( - #[deriving(PartialEq, TotalEq, Clone)] + #[deriving(PartialEq, Eq, Clone)] $(#[$attr])* pub struct $BitFlags { bits: $T, diff --git a/src/libstd/io/net/ip.rs b/src/libstd/io/net/ip.rs index 4d0e5e7f72d..bdc4b6071fa 100644 --- a/src/libstd/io/net/ip.rs +++ b/src/libstd/io/net/ip.rs @@ -25,7 +25,7 @@ use slice::{MutableCloneableVector, ImmutableVector, MutableVector}; pub type Port = u16; -#[deriving(PartialEq, TotalEq, Clone, Hash)] +#[deriving(PartialEq, Eq, Clone, Hash)] pub enum IpAddr { Ipv4Addr(u8, u8, u8, u8), Ipv6Addr(u16, u16, u16, u16, u16, u16, u16, u16) @@ -56,7 +56,7 @@ impl fmt::Show for IpAddr { } } -#[deriving(PartialEq, TotalEq, Clone, Hash)] +#[deriving(PartialEq, Eq, Clone, Hash)] pub struct SocketAddr { pub ip: IpAddr, pub port: Port, diff --git a/src/libstd/io/process.rs b/src/libstd/io/process.rs index 8325ee4ccd9..1ed46593562 100644 --- a/src/libstd/io/process.rs +++ b/src/libstd/io/process.rs @@ -317,7 +317,7 @@ impl fmt::Show for Command { } /// The output of a finished process. -#[deriving(PartialEq, TotalEq, Clone)] +#[deriving(PartialEq, Eq, Clone)] pub struct ProcessOutput { /// The status (exit code) of the process. pub status: ProcessExit, @@ -348,7 +348,7 @@ pub enum StdioContainer { /// Describes the result of a process after it has terminated. /// Note that Windows have no signals, so the result is usually ExitStatus. -#[deriving(PartialEq, TotalEq, Clone)] +#[deriving(PartialEq, Eq, Clone)] pub enum ProcessExit { /// Normal termination with an exit status. ExitStatus(int), diff --git a/src/libstd/path/posix.rs b/src/libstd/path/posix.rs index fbecbd7665b..a6bbf22b401 100644 --- a/src/libstd/path/posix.rs +++ b/src/libstd/path/posix.rs @@ -13,7 +13,7 @@ use container::Container; use c_str::{CString, ToCStr}; use clone::Clone; -use cmp::{PartialEq, TotalEq}; +use cmp::{PartialEq, Eq}; use from_str::FromStr; use io::Writer; use iter::{DoubleEndedIterator, AdditiveIterator, Extendable, Iterator, Map}; @@ -65,7 +65,7 @@ impl PartialEq for Path { } } -impl TotalEq for Path {} +impl Eq for Path {} impl FromStr for Path { fn from_str(s: &str) -> Option { diff --git a/src/libstd/path/windows.rs b/src/libstd/path/windows.rs index d46a373de4d..865e53cbe38 100644 --- a/src/libstd/path/windows.rs +++ b/src/libstd/path/windows.rs @@ -13,7 +13,7 @@ use ascii::AsciiCast; use c_str::{CString, ToCStr}; use clone::Clone; -use cmp::{PartialEq, TotalEq}; +use cmp::{PartialEq, Eq}; use container::Container; use from_str::FromStr; use io::Writer; @@ -86,7 +86,7 @@ impl PartialEq for Path { } } -impl TotalEq for Path {} +impl Eq for Path {} impl FromStr for Path { fn from_str(s: &str) -> Option { diff --git a/src/libstd/prelude.rs b/src/libstd/prelude.rs index ac1aaa2c6ca..cce2cce0d6e 100644 --- a/src/libstd/prelude.rs +++ b/src/libstd/prelude.rs @@ -58,7 +58,7 @@ #[doc(no_inline)] pub use c_str::ToCStr; #[doc(no_inline)] pub use char::Char; #[doc(no_inline)] pub use clone::Clone; -#[doc(no_inline)] pub use cmp::{PartialEq, PartialOrd, TotalEq, TotalOrd}; +#[doc(no_inline)] pub use cmp::{PartialEq, PartialOrd, Eq, Ord}; #[doc(no_inline)] pub use cmp::{Ordering, Less, Equal, Greater, Equiv}; #[doc(no_inline)] pub use container::{Container, Mutable, Map, MutableMap}; #[doc(no_inline)] pub use container::{Set, MutableSet}; @@ -81,9 +81,9 @@ #[doc(no_inline)] pub use tuple::{Tuple5, Tuple6, Tuple7, Tuple8}; #[doc(no_inline)] pub use tuple::{Tuple9, Tuple10, Tuple11, Tuple12}; #[doc(no_inline)] pub use slice::{CloneableVector, ImmutableCloneableVector}; -#[doc(no_inline)] pub use slice::{MutableCloneableVector, MutableTotalOrdVector}; +#[doc(no_inline)] pub use slice::{MutableCloneableVector, MutableOrdVector}; #[doc(no_inline)] pub use slice::{ImmutableVector, MutableVector}; -#[doc(no_inline)] pub use slice::{ImmutableEqVector, ImmutableTotalOrdVector}; +#[doc(no_inline)] pub use slice::{ImmutableEqVector, ImmutableOrdVector}; #[doc(no_inline)] pub use slice::{Vector, VectorVector, OwnedVector}; #[doc(no_inline)] pub use slice::MutableVectorAllocating; #[doc(no_inline)] pub use string::String; diff --git a/src/libstd/slice.rs b/src/libstd/slice.rs index 430629a1f88..5753663dd87 100644 --- a/src/libstd/slice.rs +++ b/src/libstd/slice.rs @@ -65,7 +65,7 @@ Vectors are a very useful type, and so there's several implementations of traits from other modules. Some notable examples: * `Clone` -* `Eq`, `Ord`, `TotalEq`, `TotalOrd` -- vectors can be compared, +* `Eq`, `Ord`, `Eq`, `Ord` -- vectors can be compared, if the element type defines the corresponding trait. ## Iteration @@ -101,7 +101,7 @@ There are a number of free functions that create or take vectors, for example: use mem::transmute; use clone::Clone; -use cmp::{TotalOrd, Ordering, Less, Greater}; +use cmp::{Ord, Ordering, Less, Greater}; use cmp; use container::Container; use iter::*; @@ -117,7 +117,7 @@ use vec::Vec; pub use core::slice::{ref_slice, mut_ref_slice, Splits, Windows}; pub use core::slice::{Chunks, Vector, ImmutableVector, ImmutableEqVector}; -pub use core::slice::{ImmutableTotalOrdVector, MutableVector, Items, MutItems}; +pub use core::slice::{ImmutableOrdVector, MutableVector, Items, MutItems}; pub use core::slice::{MutSplits, MutChunks}; pub use core::slice::{bytes, MutableCloneableVector}; @@ -698,7 +698,7 @@ impl<'a,T> MutableVectorAllocating<'a, T> for &'a mut [T] { /// Methods for mutable vectors with orderable elements, such as /// in-place sorting. -pub trait MutableTotalOrdVector { +pub trait MutableOrdVector { /// Sort the vector, in place. /// /// This is equivalent to `self.sort_by(|a, b| a.cmp(b))`. @@ -714,7 +714,7 @@ pub trait MutableTotalOrdVector { fn sort(self); } -impl<'a, T: TotalOrd> MutableTotalOrdVector for &'a mut [T] { +impl<'a, T: Ord> MutableOrdVector for &'a mut [T] { #[inline] fn sort(self) { self.sort_by(|a,b| a.cmp(b)) diff --git a/src/libstd/str.rs b/src/libstd/str.rs index 11b9d0e85ff..3af3821486f 100644 --- a/src/libstd/str.rs +++ b/src/libstd/str.rs @@ -70,7 +70,7 @@ is the same as `&[u8]`. use char::Char; use char; use clone::Clone; -use cmp::{PartialEq, TotalEq, PartialOrd, TotalOrd, Equiv, Ordering}; +use cmp::{PartialEq, Eq, PartialOrd, Ord, Equiv, Ordering}; use container::Container; use default::Default; use fmt; @@ -575,7 +575,7 @@ impl<'a> PartialEq for MaybeOwned<'a> { } } -impl<'a> TotalEq for MaybeOwned<'a> {} +impl<'a> Eq for MaybeOwned<'a> {} impl<'a> PartialOrd for MaybeOwned<'a> { #[inline] @@ -584,7 +584,7 @@ impl<'a> PartialOrd for MaybeOwned<'a> { } } -impl<'a> TotalOrd for MaybeOwned<'a> { +impl<'a> Ord for MaybeOwned<'a> { #[inline] fn cmp(&self, other: &MaybeOwned) -> Ordering { self.as_slice().cmp(&other.as_slice()) diff --git a/src/libstd/string.rs b/src/libstd/string.rs index 29d3c718682..80973bb5328 100644 --- a/src/libstd/string.rs +++ b/src/libstd/string.rs @@ -30,7 +30,7 @@ use str; use vec::Vec; /// A growable string stored as a UTF-8 encoded buffer. -#[deriving(Clone, PartialEq, PartialOrd, TotalEq, TotalOrd)] +#[deriving(Clone, PartialEq, PartialOrd, Eq, Ord)] pub struct String { vec: Vec, } diff --git a/src/libstd/vec.rs b/src/libstd/vec.rs index 3cac6fadb94..916ba083b3e 100644 --- a/src/libstd/vec.rs +++ b/src/libstd/vec.rs @@ -12,7 +12,7 @@ use RawVec = raw::Vec; use clone::Clone; -use cmp::{PartialOrd, PartialEq, Ordering, TotalEq, TotalOrd, max}; +use cmp::{PartialOrd, PartialEq, Ordering, Eq, Ord, max}; use container::{Container, Mutable}; use default::Default; use fmt; @@ -27,7 +27,7 @@ use ptr; use raw::Slice; use rt::heap::{allocate, reallocate, deallocate}; use slice::{ImmutableEqVector, ImmutableVector, Items, MutItems, MutableVector}; -use slice::{MutableTotalOrdVector, OwnedVector, Vector}; +use slice::{MutableOrdVector, OwnedVector, Vector}; use slice::{MutableVectorAllocating}; /// An owned, growable vector. @@ -388,9 +388,9 @@ impl PartialOrd for Vec { } } -impl TotalEq for Vec {} +impl Eq for Vec {} -impl TotalOrd for Vec { +impl Ord for Vec { #[inline] fn cmp(&self, other: &Vec) -> Ordering { self.as_slice().cmp(&other.as_slice()) @@ -1263,7 +1263,7 @@ impl Vec { } } -impl Vec { +impl Vec { /// Sorts the vector in place. /// /// This sort is `O(n log n)` worst-case and stable, but allocates -- cgit 1.4.1-3-g733a5