Function brownstone::build_cloned[][src]

pub fn build_cloned<T: Clone, const N: usize>(item: T) -> [T; N]
Expand description

Build a fixed-size array out of clones of some element. The element itself is used as the first element in the array.

Example

let array: [Vec<i32>; 4] = brownstone::build_cloned(vec![1, 2, 3]);
assert_eq!(
    array,
    [
        [1, 2, 3],
        [1, 2, 3],
        [1, 2, 3],
        [1, 2, 3],
    ]
)