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 @@ -1294,9 +1294,6 @@ impl<A: PartialEq> PartialEq for RingBuf<A> {
12941294 self . len ( ) == other. len ( ) &&
12951295 self . iter ( ) . zip ( other. iter ( ) ) . all ( |( a, b) | a. eq ( b) )
12961296 }
1297- fn ne ( & self , other : & RingBuf < A > ) -> bool {
1298- !self . eq ( other)
1299- }
13001297}
13011298
13021299impl < 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}
@@ -489,6 +488,14 @@ impl<V:Clone> VecMap<V> {
489488 }
490489}
491490
491+ impl < V : PartialEq > PartialEq for VecMap < V > {
492+ fn eq ( & self , other : & VecMap < V > ) -> bool {
493+ iter:: order:: eq ( self . iter ( ) , other. iter ( ) )
494+ }
495+ }
496+
497+ impl < V : Eq > Eq for VecMap < V > { }
498+
492499impl < V : PartialOrd > PartialOrd for VecMap < V > {
493500 #[ inline]
494501 fn partial_cmp ( & self , other : & VecMap < V > ) -> Option < Ordering > {
@@ -952,6 +959,10 @@ mod test_map {
952959 assert ! ( a != b) ;
953960 assert ! ( b. insert( 5 , 19 ) . is_none( ) ) ;
954961 assert ! ( a == b) ;
962+
963+ a = VecMap :: new ( ) ;
964+ b = VecMap :: with_capacity ( 1 ) ;
965+ assert ! ( a == b) ;
955966 }
956967
957968 #[ test]
You can’t perform that action at this time.
0 commit comments