File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -1295,9 +1295,6 @@ impl<A: PartialEq> PartialEq for RingBuf<A> {
12951295 self . len ( ) == other. len ( ) &&
12961296 self . iter ( ) . zip ( other. iter ( ) ) . all ( |( a, b) | a. eq ( b) )
12971297 }
1298- fn ne ( & self , other : & RingBuf < A > ) -> bool {
1299- !self . eq ( other)
1300- }
13011298}
13021299
13031300impl < A : Eq > Eq for RingBuf < A > { }
Original file line number Diff line number Diff line change @@ -60,7 +60,6 @@ use vec::Vec;
6060/// months.clear();
6161/// assert!(months.is_empty());
6262/// ```
63- #[ deriving( PartialEq , Eq ) ]
6463pub struct VecMap < V > {
6564 v : Vec < Option < V > > ,
6665}
@@ -492,6 +491,14 @@ impl<V:Clone> VecMap<V> {
492491 }
493492}
494493
494+ impl < V : PartialEq > PartialEq for VecMap < V > {
495+ fn eq ( & self , other : & VecMap < V > ) -> bool {
496+ iter:: order:: eq ( self . iter ( ) , other. iter ( ) )
497+ }
498+ }
499+
500+ impl < V : Eq > Eq for VecMap < V > { }
501+
495502impl < V : PartialOrd > PartialOrd for VecMap < V > {
496503 #[ inline]
497504 fn partial_cmp ( & self , other : & VecMap < V > ) -> Option < Ordering > {
@@ -955,6 +962,10 @@ mod test_map {
955962 assert ! ( a != b) ;
956963 assert ! ( b. insert( 5 , 19 ) . is_none( ) ) ;
957964 assert ! ( a == b) ;
965+
966+ a = VecMap :: new ( ) ;
967+ b = VecMap :: with_capacity ( 1 ) ;
968+ assert ! ( a == b) ;
958969 }
959970
960971 #[ test]
You can’t perform that action at this time.
0 commit comments