Fix unsound usize::get_unchecked_mut

This commit is contained in:
Sébastien Crozet 2021-10-31 14:27:32 +01:00
parent 8ea8ac70d5
commit df51de0664

View File

@ -589,7 +589,10 @@ where
where where
S: RawStorageMut<T, R, C>, S: RawStorageMut<T, R, C>,
{ {
matrix.data.get_unchecked_linear_mut(self) let nrows = matrix.shape().0;
let row = self % nrows;
let col = self / nrows;
matrix.data.get_unchecked_mut(row, col)
} }
} }