about summary refs log tree commit diff
path: root/src/libstd/vec.rs
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2014-03-23 22:54:42 +1100
committerHuon Wilson <dbau.pp+github@gmail.com>2014-03-23 23:48:10 +1100
commitf6db0ef9464a17fa6e547e755b1b5dfa09af9499 (patch)
tree671ec7c6a30cc425d47f83ca1b4efd2f1c71dbca /src/libstd/vec.rs
parent2ddb60565423bdc225ccc8dd4ebfb653c5650ba2 (diff)
downloadrust-f6db0ef9464a17fa6e547e755b1b5dfa09af9499.tar.gz
rust-f6db0ef9464a17fa6e547e755b1b5dfa09af9499.zip
std: remove the `equals` method from `TotalEq`.
`TotalEq` is now just an assertion about the `Eq` impl of a
type (i.e. `==` is a total equality if a type implements `TotalEq`) so
the extra method is just confusing.

Also, a new method magically appeared as a hack to allow deriving to
assert that the contents of a struct/enum are also TotalEq, because the
deriving infrastructure makes it very hard to do anything but create a
trait method. (You didn't hear about this horrible work-around from me
:(.)
Diffstat (limited to 'src/libstd/vec.rs')
-rw-r--r--src/libstd/vec.rs7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/libstd/vec.rs b/src/libstd/vec.rs
index c1f5dea91d1..d00a411e9a0 100644
--- a/src/libstd/vec.rs
+++ b/src/libstd/vec.rs
@@ -339,12 +339,7 @@ impl<T: Ord> Ord for Vec<T> {
     }
 }
 
-impl<T: TotalEq> TotalEq for Vec<T> {
-    #[inline]
-    fn equals(&self, other: &Vec<T>) -> bool {
-        self.as_slice().equals(&other.as_slice())
-    }
-}
+impl<T: TotalEq> TotalEq for Vec<T> {}
 
 impl<T: TotalOrd> TotalOrd for Vec<T> {
     #[inline]