I have a struct member vector that might be presented and might not. The obvious choice is to put it behind Option
.
But if I do that, when I'll set the option to None
, I'll free the vector. The next time it will have to be re-allocated.
This is bad. I want to re-use the capacity from the previous time.
I can build a container that does that, but is there a built-in way to do this?