Fix bug - PartialEq for Matrix no longer panics when shapes do not match

This commit is contained in:
S.Brandeis 2020-01-19 03:06:00 +01:00 committed by Sébastien Crozet
parent 39a433c0e7
commit 2b8410e08b

View File

@ -1350,12 +1350,11 @@ where
S: Storage<N, R, C>, S: Storage<N, R, C>,
{ {
#[inline] #[inline]
fn eq(&self, right: &Matrix<N, R, C, S>) -> bool { fn eq(&self, right: &Matrix<N, R2, C2, S2>) -> bool {
assert!( if self.shape() == right.shape() {
self.shape() == right.shape(), return self.iter().zip(right.iter()).all(|(l, r)| l == r)
"Matrix equality test dimension mismatch." }
); false
self.iter().zip(right.iter()).all(|(l, r)| l == r)
} }
} }