pub fn push_left<const N: usize, T>(a: [T; N], b: T) -> [T; { _ }]
Expand description
Extends the given element b
by the given array a
. Returns a new array
which is the direct extension of a
by b
. No elements are dropped, copied
or cloned.
ยงExample
let arr = [2usize, 3, 4, 5];
let elem = 1;
let prepended = push_left(arr, elem);
assert_eq!(prepended, [1, 2, 3, 4, 5]);