Skip to content

Commit 15bb9b4

Browse files
author
blake2-ppc
committed
extra::dlist: Fix bug in Eq::ne
1 parent 479aefb commit 15bb9b4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/libextra/dlist.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ impl<A: Eq> Eq for DList<A> {
594594
}
595595

596596
fn ne(&self, other: &DList<A>) -> bool {
597-
self.len() != other.len() &&
597+
self.len() != other.len() ||
598598
iterator::order::ne(self.iter(), other.iter())
599599
}
600600
}
@@ -978,6 +978,10 @@ mod tests {
978978
assert!(n != m);
979979
m.push_back(1);
980980
assert_eq!(&n, &m);
981+
982+
let n = list_from([2,3,4]);
983+
let m = list_from([1,2,3]);
984+
assert!(n != m);
981985
}
982986

983987
#[test]

0 commit comments

Comments
 (0)