pub fn from_fn<T, const N: usize, F>(cb: F) -> [T; N] where F: FnMut(usize) -> T,
Creates an array [T; N] where each array element T is returned by the cb call.
[T; N]
T
cb
let array = core::array::from_fn(|i| i); assert_eq!(array, [0, 1, 2, 3, 4]);