Skip to content

Doc states no iter_mut on HashMap but there is #94755

Closed
@BarePotato

Description

@BarePotato

//! While many collections offer `iter()`, not all offer `iter_mut()`. For
//! example, mutating the keys of a [`HashSet<T>`] or [`HashMap<K, V>`] could
//! put the collection into an inconsistent state if the key hashes change, so
//! these collections only offer `iter()`.

While many collections offer iter(), not all offer iter_mut(). For example, mutating the keys of a HashSet or HashMap<K, V> could put the collection into an inconsistent state if the key hashes change, so these collections only offer iter().

HashMap clearly has iter_mut https://doc.rust-lang.org/std/collections/struct.HashMap.html#method.iter_mut while HashSet does not.

Docs should be changed to reflect this. I would be happy to do this, but as I have not contributed to Rust before, wanted to make sure I didn't miss something here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions