Implement Clone, Eq and PartialEq for Error.#218
Conversation
|
Can I just get more details on when you would use eq on the error instead of on the error kind? And when is PartialEq not enough? |
|
I'd like to be able to #[error(Debug, Clone, Eq, PartialEq, thiserror::Error)]
pub enum MyError {
#[error("JWT error: {0}")]
Jwt(jsonwebtokenerror::Error),
#[error("Some other error...")]
SomeOtherError(...),
...
}For the derive macros to work, the various wrapped error types need to implement As for |
serde_json::Error doesn't implement Clone, so wrapped it in an Arc.
* Implement Eq and PartialEq for Error. * Implement Clone for Error. serde_json::Error doesn't implement Clone, so wrapped it in an Arc.
This fixes #217.