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
feat: add standard derives to all public types #505
Conversation
C-COMMON-TRAITS
and C-SERDE
Oh, and sorry for that messy looking commit history! I assume you'll squash things, but a lot of those commits were me re-syncing my fork with your master branch before starting this work. Only the last two commits should actually contain any changes! |
As far as I can tell, @coveralls might just be confused by the changing of formatting from adding the derives! I don't see any other way coverage has changed! |
Hello @TheLostLambda, Thank for this pull request and for discover of Rust API Guidelines. Except some not required change in benchmark, this pull request seems good. I run a benchmark to check if change have an impact on computation time, moreover so noise in benchmark, it's seems this pull request didn't have any impact on runtime. @TheLostLambda the lost of 0.01% of code coverage isn't realy important. Before merge you could probably rebase your commit on top of rust-bio change ? @rust-bio/mergers I think this pull request is ready to merge. |
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.
It's good for me
Could I poke @johanneskoester about getting this merged? I'd also be quite keen in joining the mergers team in the future! There is a lot of work with this library in my future and it would be great if could get a bit more involved in its maintenance! Thanks a ton and sorry for pestering! |
Awesome @TheLostLambda! Thanks a lot!
|
You have an invite! |
Implement Rust API Guidelines
C-COMMON-TRAITS
andC-SERDE
In working with Rust bio, I needed to fork the project in order to serialize some public types like
Orf
. Missing derive implementations is a common problem I seem to encounter when working with many crates, so I took the afternoon to add every recommended trait (#[derive(Default, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Serialize, Deserialize)]
) to everypub struct
andpub enum
in the crate using a script, then I sat down to sort out the compiler issues.If derives failed because a private
rust-bio
type didn't implement a certain trait, then derives for those traits were added to private types until they compiled. For derives failing because types outside ofrust-bio
don't implement a trait, those derives were removed until the code compiled.After adding all of those derives, I also cleaned up a few clippy lints in the second commit. Adding some of those
Copy
derives meant a lot of calls toClone
could be removed!Sorry this looks like a massive change! Should be relatively trivial to review though, since it should only be adding derives and not touching anything more complex.