From ecb1939ec25fb132b22557fee5781564033ad3e3 Mon Sep 17 00:00:00 2001 From: Palash Tyagi <23239946+Magnus167@users.noreply.github.com> Date: Sat, 3 May 2025 00:32:46 +0100 Subject: [PATCH] Enhance error messages in Broadcastable trait to clarify row and column count mismatches --- src/matrix/mat.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/matrix/mat.rs b/src/matrix/mat.rs index 2330da7..3bd9ed9 100644 --- a/src/matrix/mat.rs +++ b/src/matrix/mat.rs @@ -357,9 +357,9 @@ impl Broadcastable for T { impl Broadcastable for Matrix { fn to_vec(&self, rows: usize, cols: usize) -> Vec { - assert_eq!(self.rows, rows, "row count mismatch"); - assert_eq!(self.cols, cols, "col count mismatch"); - self.data.clone() + assert_eq!(self.rows, rows, "row count mismatch in broadcast"); + assert_eq!(self.cols, cols, "col count mismatch in broadcast"); + self.data.clone() // Clone the data for the broadcasted vec } }