Skip to content

add pop() to HashSet etc.? #27804

Open
Open
@birkenfeld

Description

@birkenfeld

In Python I've often found the set.pop() method useful which would remove and return a single arbitrary element of the set (or raise if empty). In Rust this should return an Option<T>, of course.

I haven't found such a method on HashSet, have I just not looked hard enough?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-collectionsArea: `std::collections`C-feature-acceptedCategory: A feature request that has been accepted pending implementation.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions