1
0
Fork 0
forked from wry/wry

autocommit 2022-02-19 19:41:18 CET

This commit is contained in:
Julian Orth 2022-02-19 19:41:18 +01:00
parent bb0468feea
commit ae66acef73
32 changed files with 880 additions and 164 deletions

11
src/utils/array.rs Normal file
View file

@ -0,0 +1,11 @@
pub fn from_fn<F, T, const N: usize>(mut cb: F) -> [T; N]
where
F: FnMut(usize) -> T,
{
let mut idx = 0;
[(); N].map(|_| {
let res = cb(idx);
idx += 1;
res
})
}