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