Restrict generic key type to only those supported#371
Restrict generic key type to only those supported#371mangalaman93 merged 1 commit intodgraph-io:mainfrom
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.