Skip to content

Feature: more control over container (eg. Vec) capacities #49385

Closed
@Diggsey

Description

@Diggsey

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

No one assigned

    Labels

    A-collectionsArea: `std::collections`C-feature-requestCategory: 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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions