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.