-
Notifications
You must be signed in to change notification settings - Fork 382
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
Restrict generic key type to only those supported #371
Restrict generic key type to only those supported #371
Conversation
|
Thanks for the PR. The only problem that I see with this is that any new type addition requires changes to the code and upgrading ristretto. |
I believe this is already the case (see linked code): https://github.com/dgraph-io/ristretto/blob/main/z/z.go#L55 Also I put the type next to the key mapping func, so it's clear they both need updating in lockstep. |
136b570
to
cf59758
Compare
Thanks for your time! 🙇 |
Without this, you can specify key types that aren't supported and then have to deal with panics, rather than more pleasant compile-time warnings.