From 699d57d9ddec32823f60b28874d141b98fc23f15 Mon Sep 17 00:00:00 2001 From: Owen Brooks Date: Fri, 17 Jun 2022 17:43:38 +1000 Subject: [PATCH] Safely get data in matrix Debug formatting --- src/base/matrix.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/base/matrix.rs b/src/base/matrix.rs index 11c500cd..77e26925 100644 --- a/src/base/matrix.rs +++ b/src/base/matrix.rs @@ -210,10 +210,7 @@ impl + fmt::Debug> fmt::De if j != 0 { write!(f, ", ")?; } - // Safety: the indices are within range - unsafe { - (*self.data.get_unchecked(i, j)).fmt(f)?; - } + self[(i, j)].fmt(f)?; } if i != nrows - 1 { write!(f, "; ")?;