[Solved] In place (128*N)-elem Vec<f32> into N-elem Vec<Vec<f32> of 128 size>

Okay. Wait a second. It's clearly possible to implement a function which shrinks the capacity to exactly equal the length:

Vec::from(vec.into_boxed_slice())

(and notice that this uses shrink_to_fit() as part of its implementation)

...sooooo I guess the documentation of shrink_to_fit is basically just trolling us?


note: I've taken this line of discussion to a new thread.

1 Like