Was it intentional to remove the std Error implementation for ASN1DecodeErr #17

Closed
opened 2021-01-07 14:50:02 -08:00 by rib · 3 comments
rib commented 2021-01-07 14:50:02 -08:00 (Migrated from github.com)

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?

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 ce2bf1407c2705cce2a6f976e9ae66e614d3485f) 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?
acw commented 2021-01-07 17:33:11 -08:00 (Migrated from github.com)

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. 😄

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](https://docs.rs/thiserror/1.0.23/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. 😄
rib commented 2021-01-08 06:09:59 -08:00 (Migrated from github.com)

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.

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.
acw commented 2021-01-08 14:40:28 -08:00 (Migrated from github.com)

Cool. I've merged your pull request, and pushed it up to crates.io as version 0.5.1.

Cool. I've merged your pull request, and pushed it up to `crates.io` as version 0.5.1.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: acw/simple_asn1#17