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

Add impl PartialEq<[u8; 32]> for ContractId #375

Closed
ureeves opened this issue Jul 26, 2024 · 0 comments · Fixed by #376
Closed

Add impl PartialEq<[u8; 32]> for ContractId #375

ureeves opened this issue Jul 26, 2024 · 0 comments · Fixed by #376
Assignees
Labels
type:enhancement Issues concerning code or feature improvement (performance, refactoring, etc)

Comments

@ureeves
Copy link
Member

ureeves commented Jul 26, 2024

Summary

Implementing the PartialEq trait, and its permutations, for [u8; 32] and ContractId will allow for downstream comparisons that now have to go through the ContractId::to_bytes or ContractId::from_bytes functions to be much more concise and easy to read.

Possible Solution (optional)

impl PartialEq<[u8; 32]> for ContractId
impl PartialEq<ContractId> for [u8; 32] // if possible
// to consider
impl<'a, 'b> PartialEq<&'b [u8; 32]> for &'a ContractId
impl<'a> PartialEq<[u8; 32]> for &'a ContractId
// ...
@HDauven HDauven added the type:enhancement Issues concerning code or feature improvement (performance, refactoring, etc) label Jul 29, 2024
@ureeves ureeves mentioned this issue Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement Issues concerning code or feature improvement (performance, refactoring, etc)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants