-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-collectionsArea: `std::collections`Area: `std::collections`C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
Currently there is only one way to reduce the capacity of a Vec
without clearing it completely: vec.shrink_to_fit()
However, often more control is needed. For example, it's common to want to shrink the capacity, but not below some threshold, eg. vec.shrink_to(MIN_CAPACITY)
.
There are probably other cases where you would want to be able to more directly control the capacity too.
Metadata
Metadata
Assignees
Labels
A-collectionsArea: `std::collections`Area: `std::collections`C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.