Closed
Description
Currently, Vec
has a resize
method which takes a new
parameter so that if the resize involves growing the vector, the new
parameter is cloned into each newly-created cell in the vector. T
must implement Clone
in order for this method to be available.
It would be useful to add a resize_default
method that instead requires that T: Default
, and calls T::default()
to fill the newly-created cells. Not only would this be ergonomic, but for certain implementations of T::default
, it might allow the compiler to make better optimizations.
Metadata
Metadata
Assignees
Labels
Area: `std::collections`Blocker: Implemented in the nightly compiler and unstable.Category: An issue tracking the progress of sth. like the implementation of an RFCLibs issues that are considered "small" or self-containedLibs issues that are tracked on the team's project board.Relevant to the library API team, which will review and decide on the PR/issue.This issue / PR is in PFCP or FCP with a disposition to merge it.The final comment period is finished for this PR / Issue.