Skip to content

Tracking Issue for {BTreeMap,BTreeSet}::retain #79025

Closed
@mbrubeck

Description

@mbrubeck

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-collectionsArea: `std::collections`C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCLibs-TrackedLibs 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.disposition-mergeThis 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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions