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

[Merged by Bors] - bevy_utils: Re-introduce with_capacity(). #2393

Closed

Conversation

tiagolam
Copy link
Contributor

Objective

Re-introduce AHashExt and respective with_capacity() implementations to give a more ergonomic way to set a HashMap / HashSet capacity.

As a note, this has also been discussed and agreed on issue #2115, which this PR addresses (leaving new() out of the AHashExt trait).

Fixes #2115.

Solution

PR #1235 had removed the AHashExt trait and respective with_capacity()s implementations, leaving only the less ergonomic HashMap::with_capacity_and_hasher(size, Default::default()) option available.

This re-introduces AHashExt and respective with_capacity() implementations to give a more ergonomic way to set a HashMap / HashSet capacity.

PR bevyengine#1235 had removed the `AHashExt` trait and respective
`with_capacity()`s implementations, leaving only the less ergonomic
`HashMap::with_capacity_and_hasher(size, Default::default())` option
available.

This re-introduces `AHashExt` and respective `with_capacity()`
implementations to give a more ergonomic way to set a `HashMap` /
`HashSet` capacity.

As a note, this has also been discussed and agreed on issue bevyengine#2115, which
this PR addresses.

Fixes bevyengine#2115.

Signed-off-by: Tiago Lam <tiagolam@gmail.com>
@github-actions github-actions bot added the S-Needs-Triage This issue needs to be labelled label Jun 25, 2021
@mockersf
Copy link
Member

bors try

bors bot added a commit that referenced this pull request Jun 25, 2021
@NathanSWard NathanSWard added C-Enhancement A new feature S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it A-Core Common functionality for all bevy apps and removed S-Needs-Triage This issue needs to be labelled labels Jun 25, 2021
@mockersf
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Jun 26, 2021
# Objective
Re-introduce `AHashExt` and respective `with_capacity()` implementations to give a more ergonomic way to set a `HashMap` / `HashSet` capacity.

As a note, this has also been discussed and agreed on issue #2115, which this PR addresses (leaving `new()` out of the `AHashExt` trait).

Fixes #2115.

## Solution
PR #1235 had removed the `AHashExt` trait and respective `with_capacity()`s implementations, leaving only the less ergonomic `HashMap::with_capacity_and_hasher(size, Default::default())` option available.

This re-introduces `AHashExt` and respective `with_capacity()` implementations to give a more ergonomic way to set a `HashMap` / `HashSet` capacity.
@bors bors bot changed the title bevy_utils: Re-introduce with_capacity(). [Merged by Bors] - bevy_utils: Re-introduce with_capacity(). Jun 26, 2021
@bors bors bot closed this Jun 26, 2021
ostwilkens pushed a commit to ostwilkens/bevy that referenced this pull request Jul 27, 2021
# Objective
Re-introduce `AHashExt` and respective `with_capacity()` implementations to give a more ergonomic way to set a `HashMap` / `HashSet` capacity.

As a note, this has also been discussed and agreed on issue bevyengine#2115, which this PR addresses (leaving `new()` out of the `AHashExt` trait).

Fixes bevyengine#2115.

## Solution
PR bevyengine#1235 had removed the `AHashExt` trait and respective `with_capacity()`s implementations, leaving only the less ergonomic `HashMap::with_capacity_and_hasher(size, Default::default())` option available.

This re-introduces `AHashExt` and respective `with_capacity()` implementations to give a more ergonomic way to set a `HashMap` / `HashSet` capacity.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Core Common functionality for all bevy apps C-Enhancement A new feature 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's HashSet missing some functionality
3 participants