Closed arlyon closed 1 year ago
Hi @arlyon , thanks for the PR. Would it be possible to just implement std::error::Error
without adding a dependency to thiserror
? I am aware that it is a very popular crate but I always try to avoid adding dependencies unless it is really necessary.
Sure! I will refactor.
This is, rather embarrassingly, now just a single line of code :sweat_smile: . Got a little lost in cleaning up boilerplate.
Thanks, merged!
I use anyhow in parts of my application, and noticed that the core error type doesn't implement std::error::Error. I have used thiserror which is a compile-time-only macro for doing this automatically. Incidentally, it also allows us to clean up some boilerplate.
This also means that errors from this library can be used downstream using the same #[from] machinery :)
I decided to move the display impl block further up now that the error display impl block was gone, but I can drop that change.