Closed videni closed 2 years ago
Well, just comparing the variant does not suffice for comparing for equality.
Hi, I remember there were issues with not having PartialEq
, but I do not quite remember what it was.
If you feel like giving it a try you can remove it and see what breaks, and we can take it from there.
yes, there will be an error, any other way please? the use case is simple, our event data is an aggregate of other aggregates, impossible to implement PartialEq.
Could you paste the error here? I'll see if it can be fixed easily.
Removing the PartialEq causes a number of tests to fail that expect to use simple assertion checks for simple enums based on "==". I think a good solution here would be to have the proc macro generate the PartialEq trait definitions based on just the enum discriminant. This way non of the tests need to be changed and we don't break anyone's code that was relying on this.
@korken89 , if you don't mind I will take a crack at this.
Created a pull request to resolve.
pull request #25
Resolved with PR #25
The event data and state data sometimes may be very complex, in my case , I have an OrderAggregate object which consist of Product, Promotion, etc, they also are big object. so it is not practical to implment PartialEQ.
removing the two traits, the end user still can compare use this way compare-enums-only-by-variant-not-value