Skip to content

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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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 RFCI-libs-radarLibs issues that are tracked on the team's radar.T-libs-api[DEPRECATED; DO NOT USE]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