bevy::utils::HashMap API is a bit unexpected compared to std::collections::HashMap #2823
Labels
C-Docs
An addition or correction to our documentation
C-Usability
A simple quality-of-life change that makes Bevy easier to use
D-Good-First-Issue
Nice and easy! A great choice to get started with Bevy
Bevy version
b91541b
Operating system & version
Win10/Debian, nightly rust
What you did
I spent a while trying to initialize a bevy::utils::HashMap, expecting it to be similar to the std lib one, but there is no new function, and the signature of from takes another HashMap, instead of letting you initialize from an array of (key, value) like in std::utils. The latter is really useful for inline initialization of known data into a HashMap.
What you expected to happen
I only had the 0.5 docs to go off and those made me think ::new and ::from worked the same way here (they just link to the std::utils::HashMap docs). This probably needs some specific documentation if it's changed intentionally. I think keeping the same ::from() behaviour as std::utils should be considered too as it's rather useful when creating HashMaps from already known data.
What actually happened
N/A
Additional information
The text was updated successfully, but these errors were encountered: