xxxxxxxxxx
pub fn array_resize<T, const INPUT_SIZE: usize, const OUTPUT_SIZE: usize>(
array: [T; INPUT_SIZE],
fill: T
) -> [T; OUTPUT_SIZE]
where
T: Copy,
xxxxxxxxxx
use array_utils::array_resize;
// Truncating unnecessary values
assert_eq!(array_resize([1, 2, 3], 0), [1, 2]);
// Inserting the `fill` value
assert_eq!(array_resize([1, 2, 3], 0), [1, 2, 3, 0]);