mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-17 05:25:37 +03:00
extra::dlist: Fix bug in Eq::ne
This commit is contained in:
@@ -594,7 +594,7 @@ fn eq(&self, other: &DList<A>) -> bool {
|
||||
}
|
||||
|
||||
fn ne(&self, other: &DList<A>) -> bool {
|
||||
self.len() != other.len() &&
|
||||
self.len() != other.len() ||
|
||||
iterator::order::ne(self.iter(), other.iter())
|
||||
}
|
||||
}
|
||||
@@ -978,6 +978,10 @@ fn test_eq() {
|
||||
assert!(n != m);
|
||||
m.push_back(1);
|
||||
assert_eq!(&n, &m);
|
||||
|
||||
let n = list_from([2,3,4]);
|
||||
let m = list_from([1,2,3]);
|
||||
assert!(n != m);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user