Open ssomers opened 3 years ago
@rustbot modify labels: +S-A-collections +S-B-unstable +S-C-tracking-issue +S-Libs-Tracked +S-T-libs
@ssomers The implementation PR has been closed, do you want to follow up or could we close this tracking issue for now?
This is a tracking issue for a range-based
drain
method onBTreeMap
andBTreeSet
, similar to the one inVec
. The feature gate for the issue is#![feature(btree_drain)]
.About tracking issues
Tracking issues are used to record the overall progress of implementation. They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions. A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature. Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Steps
Unresolved Questions
drain
the right name for a range-based function? It's equivalent toVec::drain
if you consider aVec<T>
to be aBTreeMap<usize, T>
with consecutive keys. It's not equivalent to theHashMap::drain()
without argument, andBTreeMap::drain(..)
doesn't compile without a type annotation if the key type has additionalBorrow
implementations, whereasVec::drain(..)
is always a simple way to drain everything.split_off
. Is it OK to addsplit_off_range
along the way?Implementation history
drain
: #66747