Vec

Arrays offer a fixed-size collection of values on the stack. Slices allow you to talk about any collection of values, regardless of where they’re stored or how many of them there are. What if we want to have a dynamic size? Just like we need a special struct String to hold heap-allocated strings, we need a special struct, Vec, ...

Get hands-on with 1400+ tech skills courses.