3 ms·
IMHO, it's a chicken and egg kind of thing; it's way easier to use Vecs because arrays really need const generics to actually be useful. I am interested to see
by steveklabnik 6y ago
IMHO, it's a chicken and egg kind of thing; it's way easier to use Vecs because arrays really need const generics to actually be useful. I am interested to see how this balance changes.
I know for my no_std work, const generics for arrays can't come fast enough.
- GolDDranks 6y agoI have also felt the need multiple times. Especially when passing a number of things to a function, and you need to pass ownership. You can't do that with a slice, because that's borrowed, so a Vec used to be the only option. Now there's a one option more that's going to be more lightweight than allocating a Vec :)
- oconnor663 6y agoI've often used the `arrayvec` crate for things like this. Actually one of the things I'm most excited about, once const generics is ready, is seeing something like `arrayvec` in the standard library.