-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-collectionsArea: `std::collections`Area: `std::collections`C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCLibs-TrackedLibs issues that are tracked on the team's project board.Libs issues that are tracked on the team's project board.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.
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
A-collectionsArea: `std::collections`Area: `std::collections`C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCLibs-TrackedLibs issues that are tracked on the team's project board.Libs issues that are tracked on the team's project board.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.