Make errors Clone and relax PartialEq/Eq bounds#2715
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2715 +/- ##
==========================================
- Coverage 88.91% 88.17% -0.75%
==========================================
Files 20 20
Lines 5422 5470 +48
==========================================
+ Hits 4821 4823 +2
- Misses 601 647 +46 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ee6a7f0 to
04a213e
Compare
04a213e to
ad7b081
Compare
ad7b081 to
cd391b4
Compare
9c5b321 to
79ec664
Compare
Manually implement PartialEq, Eq and Clone for types using SendSyncPhantomData. This is necessary because the default derive imposes an additional PartialEq/Eq/Clone bounds on the phantom type.
79ec664 to
9e6dc73
Compare
|
/gemini review |
|
@gemini Do you have any suggestions to make this PR better? |
|
(@raldone01 I'm just using this PR to test our new gemini AI review integration – sorry for the noise) |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request makes the error types cloneable and relaxes their PartialEq and Eq bounds, which is a great improvement for usability. The implementation is correct and well-tested. I've also included some suggestions to simplify the code by using #[derive] for Clone, PartialEq, and Eq on the error structs, which is now possible due to the changes made to SendSyncPhantomData. The PR also includes several helpful typo fixes across the codebase. Overall, great work!
|
(Obviously ignore Gemini's very dumb suggestions.) |
The first commit fixes minor spelling mistakes I noticed.
The second one makes errors clone.
I have been writing a few crates using zerocopy and I frequently want to include
SizeErrorwith a mapped source in my error types but it is notClonewhich is very inconvenient.I rolled my own error type for now but it would be nice to just utilize the fancy printing zerocopy already does for errors.