Add useful traits to errors
Opened this issue · 4 comments
tredoe commented
Please add #[derive(PartialEq, Eq, Copy, Clone, Debug)]
so the error could be compared in tests of other libraries/apps that use your library, or be copied.
Thanks in advance!
https://github.com/niax/rust-email/blob/master/src/results.rs#L4
untitaker commented
Not going to implement Copy, but fine with the rest
untitaker commented
That post is simply wrong. The error contains a string and can't implement Copy (only Clone)
untitaker commented
Well, in general it's a good idea to encode the error reason as much into an enum as possible (and not a string), so in the ideal case Copy can be derived. But not for the general case.