Skip to content

D44: maps have no into_iter, into_keys, into_values or drain #2191

Closed

Description

@ehartford

Specification collection-operations.md (D44) lists the transferring traversals of every owning keyed map:

Method Signature Yields
into_iter (move self: Self) -> MapIntoIter[K, V] (K, V)
into_keys (move self: Self) -> MapIntoKeys[K, V] K
into_values (move self: Self) -> MapIntoValues[K, V] V
drain (mut self: Self) -> MapDrain[K, V] (K, V)

None of them exist on HashMap or BTreeMap. The observing half of D44 non-compliance item 3 (iter, keys, values as view iterators) landed with #2183, #2184 and #2185. This is the transferring half. A HashMap needs a runtime operation that moves one entry out of a slot without dropping it.

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