array-const-fn-init

Initializes an array with constant values calculated by a const fn (usize) -> T

Requires Rust >= 1.45

Example

```rust use arrayconstfninit::arrayconstfninit;

const fn constdoubleit(i: usize) -> usize { i * 2 } const ARRAY: [usize; 10] = arrayconstfninit![constdoubleit; 10]; asserteq!(ARRAY, [0, 2, 4, 6, 8, 10, 12, 14, 16, 18]); ```

```rust use arrayconstfninit::arrayconstfninit;

const fn constvecs(i: usize) -> (u8, u8, u8) { (i as u8, i as u8, i as u8) } const ARRAY: [(u8, u8, u8); 4] = arrayconstfninit![constvecs; 4]; asserteq!(ARRAY, [(0, 0, 0), (1, 1, 1), (2, 2, 2), (3, 3, 3)]); ```