From 2b8410e08bc0432868cacae8e9c4655edbb7c893 Mon Sep 17 00:00:00 2001 From: "S.Brandeis" Date: Sun, 19 Jan 2020 03:06:00 +0100 Subject: [PATCH] Fix bug - PartialEq for Matrix no longer panics when shapes do not match --- src/base/matrix.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/base/matrix.rs b/src/base/matrix.rs index 95dda818..449d76cd 100644 --- a/src/base/matrix.rs +++ b/src/base/matrix.rs @@ -1350,12 +1350,11 @@ where S: Storage, { #[inline] - fn eq(&self, right: &Matrix) -> bool { - assert!( - self.shape() == right.shape(), - "Matrix equality test dimension mismatch." - ); - self.iter().zip(right.iter()).all(|(l, r)| l == r) + fn eq(&self, right: &Matrix) -> bool { + if self.shape() == right.shape() { + return self.iter().zip(right.iter()).all(|(l, r)| l == r) + } + false } }