prost icon indicating copy to clipboard operation
prost copied to clipboard

prost-types: Implement Eq for Any and Duration

Open theduke opened this issue 3 years ago • 3 comments

Manually implement the Eq trait for the Any and Duration well-known types.

These types only contain fields that are themselfes Eq.

theduke avatar Apr 15 '22 20:04 theduke

It looks like protobuf.rs is auto-generated, but I couldn't find a script or similar that does this, so I just added the impls in lib.rs

theduke avatar Apr 15 '22 20:04 theduke

@theduke the code is auto generated in the bootstrap test under tests.

LucioFranco avatar Apr 18 '22 18:04 LucioFranco

Another way to do this is by injecting the derive impls into the generated code via https://github.com/tokio-rs/prost/blob/master/tests/src/bootstrap.rs#L23 and type_attribute().

danburkert avatar Apr 20 '22 20:04 danburkert