Open
Description
Feature gate: #![feature(push_mut)]
This is a tracking issue for Vec::push_mut
, as discussed in the comments of this ACP. This adds a way to get a reference to the just-pushed value, which can eliminate having to .unwrap()
or access the back of the list twice.
Public API
#[must_use = "if you don't need a reference to the value, use Vec::push")]
pub fn push_mut(&mut self, value: T) -> &mut T { /* ... */ }
Steps / History
- Implementation: Implement
push_mut
#135975 - Final comment period (FCP)
- Stabilization PR
Unresolved Questions
None