Closed
Description
This is a tracking issue for BTreeMap::retain
and BTreeSet::retain
(part of rust-lang/rfcs#1338).
The feature gate for the issue is #![feature(btree_retain)]
.
Unstable API
impl<T: Ord> BTreeSet<T> {
pub fn retain<F>(&mut self, mut f: F) where F: FnMut(&T) -> bool;
}
impl<K: Ord, V> BTreeMap<K, V> {
pub fn retain<F>(&mut self, mut f: F) where F: FnMut(&K, &mut V) -> bool;
}
Steps
- Implement the RFC
- FCP
- Adjust documentation
- Stabilization PR
Unresolved Questions
- Is the performance of the current implementation (based on
drain_filter
) good enough to be useful? Concern raised in this comment.
Implementation history
- Initial implementation: Implement BTreeMap::retain and BTreeSet::retain #79026
Metadata
Metadata
Assignees
Labels
Area: `std::collections`Category: An issue tracking the progress of sth. like the implementation of an RFCLibs 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.