Skip to content

Conversation

@Shatur
Copy link
Contributor

@Shatur Shatur commented Oct 29, 2025

Objective

  • Calling Hashed::new could be annoying if a function accepts it.

Solution

  • Add From impl to allow creating functions that accepts impl From<V>.

@Shatur Shatur requested a review from alice-i-cecile October 29, 2025 20:57
@Shatur Shatur added this to the 0.17.3 milestone Oct 29, 2025
@Shatur Shatur added the D-Trivial Nice and easy! A great choice to get started with Bevy label Oct 29, 2025
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see the appeal, but I'm not sure how much we want to let this diverge from the standard libraries impl. Do you have a concrete use case where this was helpful?

@alice-i-cecile alice-i-cecile added A-Utils Utility functions and types X-Contentious There are nontrivial implications that should be thought through S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Oct 29, 2025
@Shatur Shatur changed the title Add From for Hasher Add From for Hashed Oct 29, 2025
@Shatur
Copy link
Contributor Author

Shatur commented Oct 29, 2025

Sorry, I made a typo - it's Hashed wrapper, not Hasher 😅. The standard library doesn't include it, so we should be good.
My main motivation is to allow passing both V and Hashed<V> into my functions.

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 D-Trivial Nice and easy! A great choice to get started with Bevy S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged X-Contentious There are nontrivial implications that should be thought through

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants