pub fn flatten_array<const N: usize, T>(
array: [Protected<T>; N],
) -> Protected<[T; N]>Expand description
Convenience function to flatten an array of Protected into a Protected array.
ยงExample
use vitaminc_protected::{flatten_array, Controlled, Protected};
let x = Protected::new(1);
let y = Protected::new(2);
let z = Protected::new(3);
let array: [Protected<u8>; 3] = [x, y, z];
let flattened = flatten_array(array);
assert!(matches!(flattened, Protected));
assert_eq!(flattened.risky_unwrap(), [1, 2, 3]);