-
Notifications
You must be signed in to change notification settings - Fork 35
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
Derive implementations #39
Conversation
Hi @oherrala, thanks for the contributions! I'm going to have to take a look into trait bounds on struct type parameters again before merging this. I had a fairly active core Rust team member caution me about trait bounds on struct type parameters as opposed to the |
Please see this issue for a discussion of trait bounds of struct type parameters: rust-lang/rust-clippy#1689. For now, I'd prefer to have those removed and I've opened an issue to evaluate whether this should indeed be the case in v0.5.0 (#43). I think I will probably maintain this requirement even in v0.5.0 simply because of the example of how easy it is to introduce breaking changes when defining trait bounds directly on struct type parameters. Once they're removed here, I'll merge this. |
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.
Please remove trait bounds on struct type parameters.
Deriving these five traits allow using these enums in HashMaps and BTreeMaps.
@jbaublitz Thanks! I force pushed new changes without the trait bounds. There was a reason I needed to add the trait bounds on structs, but now removing those I can't reproduce the issue. Dunno what the reason was, but now locally tests pass without! |
Looks good to me. Thanks for contributing! I'm merging this now. |
Thanks! |
This PR contains two things:
Derive (Partial)Eq, (Partial)Ord and Hash traits for enums. Deriving these five traits allow using these enums in HashMaps and BTreeMaps.
Derive Debug for structs in routing netlink subsystem. These make it much easier to figure out what happens by logging or print debugging.