aztec-nr - noir_aztec::utils::array::collapse

Function collapse

pub fn collapse<T, let N: u32>(input: [Option<T>; N]) -> BoundedVec<T, N>
where T: Eq

Collapses an array of Options with sparse Some values into a BoundedVec, essentially unwrapping the Options and removing the None values.

For example, given: input: [some(3), none(), some(1)] this returns collapsed: [3, 1]