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

feat: derive Eq and Hash trait for messages where possible #1175

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Oct 23, 2024

  1. feat: derive Eq and Hash trait for messages where possible

    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:
    - messages that only have fields with integer or bytes types
    - messages where all field types also implement Eq and Hash
    - the Rust enum for one-of fields, where all fields implement Eq and Hash
    
    Generated code for Protobuf enums already derives Eq and Hash.
    
    BREAKING CHANGE: `prost-build` will automatically derive `trait Eq` and `trait Hash` for types where all field support those as well. If you manually `impl Eq` and/or `impl Hash` for generated types, then you need to remove the manual implementation. If you use `type_attribute` to `derive(Eq)` and/or `derive(Hash)`, then you need to remove those.
    caspermeijn committed Oct 23, 2024
    Configuration menu
    Copy the full SHA
    5034001 View commit details
    Browse the repository at this point in the history