Open caspermeijn opened 1 month ago
LGTM, would it make sense to make these derives optional?
I think you mean something like skip_debug
but for these traits. I feel like always implementing Eq
is acceptable, as that is also the case for PartialEq
.
The disadvantage of a skip function is that the complexity is raised in the code generator.
Yeah, I was thinking it may help for those backward compat issues.
Integer and bytes types can be compared using trait Eq. Some generated Rust structs can also have this property by deriving the Eq trait.
Automatically derive Eq and Hash for:
Generated code for Protobuf enums already derives Eq and Hash.
BREAKING CHANGE:
prost-build
will automatically derivetrait Eq
andtrait Hash
for types where all field support those as well. If you manuallyimpl Eq
and/orimpl Hash
for generated types, then you need to remove the manual implementation. If you usetype_attribute
toderive(Eq)
and/orderive(Hash)
, then you need to remove those.