-
Notifications
You must be signed in to change notification settings - Fork 14k
Closed
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.
Description
Feature gate: #![feature(array_resize)]
This is a tracking issue for the resize and resize_with methods on arrays.
Like Vec::resize(_with), these extend for a larger size or truncate for a shorter one. Unlike Vec, these return a new array (because obviously one can't change the size of a fixed-size array in-place).
Public API
impl<T, const N: usize> [T; N] {
pub fn resize<const NEW_LEN: usize>(self, value: T) -> [T; NEW_LEN];
pub fn resize_with<const NEW_LEN: usize>(self, mut f: impl FnMut() -> T) -> [T; NEW_LEN];
}Steps / History
- Implementation: Add
resize(_with)and(try_)repeat(_with)for arrays #91506 - Final comment period (FCP)
- Stabilization PR
Unresolved Questions
- None yet.
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.