(
self,
mut fill: impl FnMut(usize, usize) -> T,
)
| 851 | |
| 852 | #[inline] |
| 853 | pub fn resize_with<const NEW_ROWS: usize, const NEW_COLS: usize>( |
| 854 | self, |
| 855 | mut fill: impl FnMut(usize, usize) -> T, |
| 856 | ) -> Matrix<NEW_ROWS, NEW_COLS, T> |
| 857 | where |
| 858 | T: Copy, |
| 859 | { |
| 860 | Matrix(std::array::from_fn(|row| { |
| 861 | std::array::from_fn(|col| { |
| 862 | if row < ROWS && col < COLS { |
| 863 | self.0[row][col] |
| 864 | } else { |
| 865 | fill(row, col) |
| 866 | } |
| 867 | }) |
| 868 | })) |
| 869 | } |
| 870 | |
| 871 | #[inline] |
| 872 | pub fn as_slice(&self) -> &[T] { |
no test coverage detected