Was it intentional to remove the std Error implementation for ASN1DecodeErr #17
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi, thanks for the handy crate.
I was just looking at bumping to 0.5 but hit an issue since ASN1DecodeErr no longer implements std Error (removed in
ce2bf1407c) and I'm not sure if that was intentional or maybe I'm not familiar with some short hand for converting to a std Error that I should use?It was an intentional decision, but possibly not a good one. I've recently been learning about a couple of the newer options for errors in Rust libraries; thiserror, in particular. An update to the errors in this library to use these sorts of conveniences would probably be a good idea.
I'll take a look at how hard it is, and see if I can't put something together quickly. Unless you're super inspired, in which case I'd point you towards
thiserror, and I'm happy to accept a patch to improve the errors. 😄Okey, no worries - that's a neat macro which I hadn't seen before (will probably start using that myself too).
I made a pull request (https://github.com/acw/simple_asn1/pull/18) with changes to use thiserror, including using the
#[error()]syntax for also automatically implementing Display which seems to work for my jsonwebtokens crate.Cool. I've merged your pull request, and pushed it up to
crates.ioas version 0.5.1.