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

impl Borrow and AsRef for CowArc #11616

Merged
merged 2 commits into from
Jan 30, 2024

Conversation

tguichaoua
Copy link
Contributor

@tguichaoua tguichaoua commented Jan 30, 2024

Objective

  • Allow HashMap<Cow<'_, T>, _> to use &T as key for HashMap::get
  • Makes CowArc more like Cow

Solution

Implements Borrow<T> and AsRef<T> for CowArc<T>.

@tguichaoua tguichaoua changed the title impl Borrow for CowArc impl Borrow and AsRef for CowArc Jan 30, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jan 30, 2024
@alice-i-cecile alice-i-cecile added C-Usability A simple quality-of-life change that makes Bevy easier to use A-Utils Utility functions and types S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it labels Jan 30, 2024
Merged via the queue into bevyengine:main with commit 4b7ef44 Jan 30, 2024
25 checks passed
@tguichaoua tguichaoua deleted the cow_arc_borrow branch January 30, 2024 14:43
tjamaan pushed a commit to tjamaan/bevy that referenced this pull request Feb 6, 2024
# Objective

- Allow `HashMap<Cow<'_, T>, _>` to use `&T` as key for `HashMap::get`
- Makes `CowArc` more like `Cow`

## Solution

Implements `Borrow<T>` and `AsRef<T>` for `CowArc<T>`.
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 simple 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.

None yet

3 participants