Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bevy_utils: Add BuildHasher parameter to bevy_utils::Entry type alias #12308

Merged
merged 1 commit into from
Mar 5, 2024

Conversation

MrGVSV
Copy link
Member

@MrGVSV MrGVSV commented Mar 5, 2024

Objective

bevy_utils::Entry is only useful when using BuildHasherDefault<AHasher>. It would be great if we didn't have to write out bevy_utils::hashbrown::hash_map::Entry whenever we want to use a different BuildHasher, such as when working with bevy_utils::TypeIdMap.

Solution

Give bevy_utils::Entry a new optional type parameter for defining a custom BuildHasher, such as NoOpHash. This parameter defaults to BuildHasherDefault<AHasher>— the BuildHasher used by bevy_utils::HashMap.


Changelog

  • Added an optional third type parameter to bevy_utils::Entry to specify a custom BuildHasher

@MrGVSV MrGVSV added C-Usability A targeted quality-of-life change that makes Bevy easier to use A-Utils Utility functions and types labels Mar 5, 2024
@james7132
Copy link
Member

Merging as trivial.

@james7132 james7132 added this pull request to the merge queue Mar 5, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 5, 2024
@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 Mar 5, 2024
@james7132 james7132 added this pull request to the merge queue Mar 5, 2024
Merged via the queue into bevyengine:main with commit 5b69613 Mar 5, 2024
29 checks passed
@MrGVSV MrGVSV deleted the mrgvsv/utils/entry branch March 5, 2024 03:21
spectria-limina pushed a commit to spectria-limina/bevy that referenced this pull request Mar 9, 2024
…lias (bevyengine#12308)

# Objective

`bevy_utils::Entry` is only useful when using
`BuildHasherDefault<AHasher>`. It would be great if we didn't have to
write out `bevy_utils::hashbrown::hash_map::Entry` whenever we want to
use a different `BuildHasher`, such as when working with
`bevy_utils::TypeIdMap`.

## Solution

Give `bevy_utils::Entry` a new optional type parameter for defining a
custom `BuildHasher`, such as `NoOpHash`. This parameter defaults to
`BuildHasherDefault<AHasher>`— the `BuildHasher` used by
`bevy_utils::HashMap`.

---

## Changelog

- Added an optional third type parameter to `bevy_utils::Entry` to
specify a custom `BuildHasher`
mtsr pushed a commit to mtsr/bevy that referenced this pull request Mar 15, 2024
…lias (bevyengine#12308)

# Objective

`bevy_utils::Entry` is only useful when using
`BuildHasherDefault<AHasher>`. It would be great if we didn't have to
write out `bevy_utils::hashbrown::hash_map::Entry` whenever we want to
use a different `BuildHasher`, such as when working with
`bevy_utils::TypeIdMap`.

## Solution

Give `bevy_utils::Entry` a new optional type parameter for defining a
custom `BuildHasher`, such as `NoOpHash`. This parameter defaults to
`BuildHasherDefault<AHasher>`— the `BuildHasher` used by
`bevy_utils::HashMap`.

---

## Changelog

- Added an optional third type parameter to `bevy_utils::Entry` to
specify a custom `BuildHasher`
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-Usability A targeted quality-of-life change that makes Bevy easier to use 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.

3 participants