Skip to content

drain_filter has opposite behavior of standard library version #186

Closed
@mbrubeck

Description

@mbrubeck

In methods like std::vec::Vec::drain_filter, the element is removed if the closure returns true. But in hashbrown::HashMap::drain_filter (#135) and hashbrown::HashSet::drain_filter (#179), the element is removed if the closure returns false. 😦

cc rust-lang/rust#59618


Update: This is fixed in hashbrown 0.9.0. When upgrading from earlier versions, all callers must flip the meaning of the predicate passed to the drain_filter method. I have submitted pull requests to all the affected crates I could find.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions