> Aztec.nr API reference, v6.0.0 (mainnet and testnet). Index: https://docs.aztec.network/aztec-nr-api/v6.0.0/llms.txt

# Function collapse

Module: `noir_aztec::utils::array::collapse`

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

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

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