3 ms·
There's also an open Pull Request for adding std::array::from_fn which calls the function / closure provided N times to initialize an array. This basically brin
by CryZe 5y ago
There's also an open Pull Request for adding std::array::from_fn which calls the function / closure provided N times to initialize an array. This basically brings the array-init functionality into std.
https://github.com/rust-lang/rust/pull/75644 https://github.com/rust-lang/rust/pull/75644
- skohan 5y agoI wrote a graphics library in Swift that uses a method like this to initialize buffers and it's super useful