-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
T-libs-apiRelevant to the library API team, which will review and decide on the RFC.Relevant to the library API team, which will review and decide on the RFC.
Description
It is annoying to manually fetch the last element, which is unsurprisingly quite common after a push. The most obvious thing would be to make Vec::<T>::push()
return a &mut T
, but this is strictly speaking a breaking change. It would be cool to get some crater data on whether this in practice is an issue (i.e. if people don't put the ;
after push()
in functions returning ()
).
The more realistic change is to add a method, push_ref
, returning &mut T
.
birkenfeld, comex, Rufflewind, rimmington, willcassella and 9 moreAaronRecord
Metadata
Metadata
Assignees
Labels
T-libs-apiRelevant to the library API team, which will review and decide on the RFC.Relevant to the library API team, which will review and decide on the RFC.