Skip to content

[Merged by Bors] - explain absence of new constructor in Hash{Map, Set} docs; suggest default#3077

Closed
dataphract wants to merge 1 commit intobevyengine:mainfrom
dataphract:doc/hashmap-default
Closed

[Merged by Bors] - explain absence of new constructor in Hash{Map, Set} docs; suggest default#3077
dataphract wants to merge 1 commit intobevyengine:mainfrom
dataphract:doc/hashmap-default

Conversation

@dataphract
Copy link
Member

Objective

Fixes #2823.

Solution

This PR adds notes to the HashMap and HashSet docs explaining why HashMap::new() (resp. HashSet::new()) is not available, and guiding the user toward using the Default implementation for an empty collection.

@github-actions github-actions bot added the S-Needs-Triage This issue needs to be labelled label Nov 6, 2021
@alice-i-cecile alice-i-cecile added C-Docs An addition or correction to our documentation and removed S-Needs-Triage This issue needs to be labelled labels Nov 6, 2021
@alice-i-cecile
Copy link
Member

@cart can we get A-Utils tag?

@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Nov 6, 2021
@cart
Copy link
Member

cart commented Nov 6, 2021

@alice-i-cecile

can we get A-Utils tag?

done!

@cart cart added the A-Utils Utility functions and types label Nov 6, 2021
@cart
Copy link
Member

cart commented Nov 6, 2021

bors r+

bors bot pushed a commit that referenced this pull request Nov 6, 2021
…`default` (#3077)

# Objective

Fixes #2823.

## Solution

This PR adds notes to the `HashMap` and `HashSet` docs explaining why `HashMap::new()` (resp. `HashSet::new()`) is not available, and guiding the user toward using the `Default` implementation for an empty collection.
@bors bors bot changed the title explain absence of new constructor in Hash{Map, Set} docs; suggest default [Merged by Bors] - explain absence of new constructor in Hash{Map, Set} docs; suggest default Nov 6, 2021
@bors bors bot closed this Nov 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Utils Utility functions and types C-Docs An addition or correction to our documentation S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bevy::utils::HashMap API is a bit unexpected compared to std::collections::HashMap

4 participants