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 @@ -1294,9 +1294,6 @@ impl<A: PartialEq> PartialEq for RingBuf<A> {
1294
1294
self . len ( ) == other. len ( ) &&
1295
1295
self . iter ( ) . zip ( other. iter ( ) ) . all ( |( a, b) | a. eq ( b) )
1296
1296
}
1297
- fn ne ( & self , other : & RingBuf < A > ) -> bool {
1298
- !self . eq ( other)
1299
- }
1300
1297
}
1301
1298
1302
1299
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
}
@@ -489,6 +488,14 @@ impl<V:Clone> VecMap<V> {
489
488
}
490
489
}
491
490
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
+
492
499
impl < V : PartialOrd > PartialOrd for VecMap < V > {
493
500
#[ inline]
494
501
fn partial_cmp ( & self , other : & VecMap < V > ) -> Option < Ordering > {
@@ -952,6 +959,10 @@ mod test_map {
952
959
assert ! ( a != b) ;
953
960
assert ! ( b. insert( 5 , 19 ) . is_none( ) ) ;
954
961
assert ! ( a == b) ;
962
+
963
+ a = VecMap :: new ( ) ;
964
+ b = VecMap :: with_capacity ( 1 ) ;
965
+ assert ! ( a == b) ;
955
966
}
956
967
957
968
#[ test]
You can’t perform that action at this time.
0 commit comments