(self, mut f: impl FnMut(usize, usize, T) -> U)
| 817 | |
| 818 | #[inline] |
| 819 | pub fn map_cells<U>(self, mut f: impl FnMut(usize, usize, T) -> U) -> Matrix<ROWS, COLS, U> |
| 820 | where |
| 821 | T: Copy, |
| 822 | { |
| 823 | Matrix(std::array::from_fn(|row| { |
| 824 | std::array::from_fn(|col| { |
| 825 | // SAFETY: array::from_fn indexes are in matrix bounds. |
| 826 | f(row, col, unsafe { *self.get_unchecked(row, col) }) |
| 827 | }) |
| 828 | })) |
| 829 | } |
| 830 | |
| 831 | #[inline] |
| 832 | pub fn resize<const NEW_ROWS: usize, const NEW_COLS: usize>( |