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

Do I really need to specify phf_shared dependency if I need to use a custom struct as key of a map? #308

Open
GyulyVGC opened this issue Feb 7, 2024 · 0 comments

Comments

@GyulyVGC
Copy link

GyulyVGC commented Feb 7, 2024

Hi everybody!

I'd like to use a custom tuple struct as key of my phf map and to do so apparently I need to implement the following traits:

  • phf_shared::PhfHash
  • phf_shared::PhfBorrow<B>
  • phf_shared::FmtConst

I managed to do it by specifying phf_shared both as a dependency and as a build-dependency, but this doesn't seem a really clean solution to me.

Is there any other (cleaner) way to access these traits / use a custom struct as key of the map?

@GyulyVGC GyulyVGC changed the title Do I really need to specify phf_shared dependency if I want to implement phf traits for a custom struct? Do I really need to specify phf_shared dependency if I need to use a custom struct as key of a map? Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant