pub fn filled_with(element: T, num_rows: usize, num_columns: usize) -> Self
    where
        T: Clone,
    {
        let total_len = num_rows * num_columns;
        let array = alloc::vec![element; total_len];
        Array2D {
            array: array.into_boxed_slice(),
            num_rows,
            num_columns,
        }
    }
/// Creates a new [`Array2D`] with the specified number of rows and columns
/// that contains `element` in every location.
///
/// # Examples
///
/// ```
/// # use array2d::{Array2D, Error};
/// let array = Array2D::filled_with(42, 2, 3);
/// assert_eq!(array.as_rows(), vec![vec![42, 42, 42], vec![42, 42, 42]]);
/// ```
///
/// [`Array2D`]: struct.Array2D.html
Creates a new [`Array2D`] with the specified number of rows and columns
that contains `element` in every location.
Creates a new [ ` Array2D ` ] with the specified number of rows and columns that contains ` element ` in every location .
pub fn filled_with(element: T, num_rows: usize, num_columns: usize) -> Self
    where
        T: Clone,
    {
        let total_len = num_rows * num_columns;
        let array = alloc::vec![element; total_len];
        Array2D {
            array: array.into_boxed_slice(),
            num_rows,
            num_columns,
        }
    }
pub fn filled_with ( element : T , num_rows : usize , num_columns : usize ) -> Self where T : Clone , { let total_len = num_rows * num_columns ; let array = alloc :: vec ! [ element total_len ] ; Array2D { array : array . into_boxed_slice ( ) , num_rows , num_columns , } }
Creates a new [`Array2D`] with the specified number of rows and columns
that contains `element` in every location.
Creates a new [ ` Array2D ` ] with the specified number of rows and columns that contains ` element ` in every location .
element
T
num_rows
usize
num_columns
usize
element
T
num_rows
usize
num_columns
usize
examples
None
use array2d::{array2d, error};
None