-
Notifications
You must be signed in to change notification settings - Fork 359
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
Implement PrimaryKey for &Addr by removing unused parse_key #264
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the simplicity of this. I think parse_key
is not used because we're implementing parsing of keys when we need it using custom helper functions.
There is an open issue to make use of It does simplify things to remove the call. Let's discuss whether we want to make #198 impossible first. If that is fine, let's do this approach. Otherwise, let's do the &K approach, which is quite nice |
My understanding is that #198 can be done independently of
I agree #265 looks like the way to go. If we're OK with tolerating some syntax issues / constructs (mostly in test code), I would say, let's go for it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good solution.
The trait
PrimaryKey
puts a lot of requirements on the type implementing it. It requires zero-copy serialization and zero-copy deserialization.However, deserializing the bytes into the key type is never used. If we remove it, we can easily implemement PrimaryKey for &Addr.
Do not merge as is. Target branch is a copy of the fork from #260.