File tree 2 files changed +12
-4
lines changed
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> {
1295
1295
self . len ( ) == other. len ( ) &&
1296
1296
self . iter ( ) . zip ( other. iter ( ) ) . all ( |( a, b) | a. eq ( b) )
1297
1297
}
1298
- fn ne ( & self , other : & RingBuf < A > ) -> bool {
1299
- !self . eq ( other)
1300
- }
1301
1298
}
1302
1299
1303
1300
impl < A : Eq > Eq for RingBuf < A > { }
Original file line number Diff line number Diff line change @@ -60,7 +60,6 @@ use vec::Vec;
60
60
/// months.clear();
61
61
/// assert!(months.is_empty());
62
62
/// ```
63
- #[ deriving( PartialEq , Eq ) ]
64
63
pub struct VecMap < V > {
65
64
v : Vec < Option < V > > ,
66
65
}
@@ -492,6 +491,14 @@ impl<V:Clone> VecMap<V> {
492
491
}
493
492
}
494
493
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
+
495
502
impl < V : PartialOrd > PartialOrd for VecMap < V > {
496
503
#[ inline]
497
504
fn partial_cmp ( & self , other : & VecMap < V > ) -> Option < Ordering > {
@@ -955,6 +962,10 @@ mod test_map {
955
962
assert ! ( a != b) ;
956
963
assert ! ( b. insert( 5 , 19 ) . is_none( ) ) ;
957
964
assert ! ( a == b) ;
965
+
966
+ a = VecMap :: new ( ) ;
967
+ b = VecMap :: with_capacity ( 1 ) ;
968
+ assert ! ( a == b) ;
958
969
}
959
970
960
971
#[ test]
You can’t perform that action at this time.
0 commit comments