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

Implement Eq and Hash for aws_sdk_ec2::types::IpPermission #1096

Closed
2 tasks
FalkWoldmann opened this issue Mar 8, 2024 · 2 comments
Closed
2 tasks

Implement Eq and Hash for aws_sdk_ec2::types::IpPermission #1096

FalkWoldmann opened this issue Mar 8, 2024 · 2 comments
Labels
feature-request A feature should be added or improved.

Comments

@FalkWoldmann
Copy link

FalkWoldmann commented Mar 8, 2024

Describe the feature

We would like to use set operations on sets of aws_sdk_ec2::types::IpPermission, but without Eq and Hash, we cannot construct HashSets containing them.

Use Case

Putting this data in a HashSet, or even a HashMap.

Proposed Solution

Just add Eq and Hash to the derive call. I tried that out locally and it compiled.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

A note for the community

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue, please leave a comment
@FalkWoldmann FalkWoldmann added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Mar 8, 2024
@rcoh
Copy link
Contributor

rcoh commented Mar 11, 2024

Yeah I understand the desire for this—unfortunately we can't for backwards compatibility reasons. Suppose, e.g. an f64 was added to the type in the future, then we wouldn't be able to implement Eq/Hash. I'll note that PartialEq is implemented, however.

I'd suggest making a struct that extracts a subset of the fields and deriving hash on that instead. Sorry we couldn't be more helpful.

@rcoh rcoh removed the needs-triage This issue or PR still needs to be triaged. label Mar 11, 2024
@jmklix jmklix closed this as completed Mar 15, 2024
Copy link

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

3 participants