profile
viewpoint

Ask questionsTracking issue for HashMap::extract_if and HashSet::extract_if

The feature gate for the issue is #![feature(hash_extract_if)] (previously hash_drain_filter)

Currently only Vec and LinkedList have a drain_filter method, while other collections such as HashMap and HashSet do not.

This means that currently, removing items from a collection, and getting ownership of those items is fairly...unidiomatic and cumbersome.

For references, see https://github.com/rust-lang/rfcs/issues/2140

Implementation History

  • #76458
  • removed drain-on-drop behavior, renamed to extract_if
    • #104455
    • https://github.com/rust-lang/libs-team/issues/136
rust-lang/rust

Answer questions the8472

Currently waiting for a hashbrown release so that drain_filter can be replaced with extract_if.

useful!

Related questions

No questions were found.
source:https://uonfu.com/
Github User Rank List