`grow_to` method is implemented
Increases the capacity of the vector at least up to the new_capacity
:
- has no affect if
new_capacity <= self.capacity()
, and returnsOk(self.capacity())
; - increases the capacity to
x >= new_capacity
otherwise if the operation succeeds.
This method is unsafe due to the internal guarantees of pinned vectors.
- A
SplitVec
, on the other hand, can grow to thenew_capacity
without any problem.
However, it is not designed to have intermediate empty fragments, whilegrow_to
can leave such fragments.
Hence, the caller is responsible for handling this.