-
-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Clone support #7
Comments
In order to provide a Clone impl we would need to do either of:
The first one seems bad to me and the second one makes it impossible to downcast by value which also seems bad (fwiw failure came to the same conclusion in rust-lang-deprecated/failure#148). Is there a way for you to work around this by using Rc<Error> or Arc<Error> in the tests? |
My first though was about using Arc, but that introduced a ton of changes which were not really needed from the api standpoint. Unfortunately, the work required outweighed the benefit of using anyhow. And there's also the possibility of passing error across 3rd party crates which don't wrap results in anything. |
That's too bad. I am sorry to hear that it didn't work out for your use case! |
I was writing a question about this, but I think I answered it for myself. Here it is, in case anyone else has it. Q: How can I use A: Use a |
Currently anyhow::Error is not Clone, which makes the crate hard (or even impossible) to use with some mock crates in tests, e.g. mock-it.
The text was updated successfully, but these errors were encountered: