Skip to content
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

Additional #derive's #3

Open
wolfv opened this issue Nov 14, 2023 · 4 comments
Open

Additional #derive's #3

wolfv opened this issue Nov 14, 2023 · 4 comments

Comments

@wolfv
Copy link

wolfv commented Nov 14, 2023

I've noticed that some structs are not deriving as many things as possible. It's pretty useful to have a derived implementation for Copy/Clone/Hash/Eq/PartialEq etc.

@dralley
Copy link
Owner

dralley commented Nov 14, 2023

@wolfv Which structs?

@wolfv
Copy link
Author

wolfv commented Nov 14, 2023

For example Requirement can't be hashed: https://github.com/dralley/rpmrepo_metadata/blob/dcb93bea30bffc4a2bfde1036cf31357a6b23f75/src/metadata.rs#L735C1-L736C1

And a bunch of others could also have some more Derives. You can see what we had to implement here: https://github.com/prefix-dev/resolvo-rpm/blob/a54df79ef863c7c940b69c7a645a3cab8e099be6/src/rpm_provider.rs#L20-L85

@dralley
Copy link
Owner

dralley commented Nov 14, 2023

@wolfv Does this handle pretty much everything? d3e61d8

I didn't do a Display impl for Changelog or Requirement, but I believe that was only used for debugging?

@wolfv
Copy link
Author

wolfv commented Nov 14, 2023

Looks very good! Thank you, I'll test it soon :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants