-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Tracking Issue for Vec::push_within_capacity #100486
Copy link
Copy link
Open
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-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.
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Feature gate:
#![feature(vec_push_within_capacity)]This is a tracking issue for
Vec::push_within_capacityIt enables pushing into a Vec if there is any capacity left and otherwise returns the value. I.e. it avoids implicit resizing. This can be useful when one wants to explicitly control it (e.g. via
try_reserve) or uses a Vec in an unsafe manner where moving the elements would be a problem.Public API
Steps / History
Vec::push{,_mut}_within_capacity#148534Unresolved Questions
push_in_capacity)Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩