Skip to content

[Consistency Review] Map::get_or_default should use Default trait #3260

@hackwaly

Description

@hackwaly

Current behaviors

pub fn[T : Default] Option::unwrap_or_default(T?) -> T
pub fn[K : Hash + Eq, V] Map::get_or_default(Self[K, V], K, V) -> V

Expected behaviors

We should change Map::get_or_default and HashMap::get_or_default to pub fn[K : Hash + Eq, V: Default] Map::get_or_default(Self[K, V], K) -> V

Justification

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions