brycx / pasetors

PASETOrs: PASETO tokens in pure Rust
MIT License
91 stars 10 forks source link

Implement std::error::Error for Errors #27

Closed not-my-profile closed 2 years ago

not-my-profile commented 2 years ago

This is handy because it for example makes the Errors type usable with anyhow/thiserror.

Implementing std::error::Error for error types is best practice.

Sidenote: I think it's weird that the enum is named in plural.

brycx commented 2 years ago

Yes, this is def. a great idea. Don't know why this wasn't impl'd before.

Sidenote: I think it's weird that the enum is named in plural.

This is fair and I understand why haha. With the upcoming breaking changes, I'm open to renaming it.

not-my-profile commented 2 years ago

This is fair and I understand why haha. With the upcoming breaking changes, I'm open to renaming it.

Haha, ok great :) When we rename it we should also strip the Error from the variant names (as per the clippy lint).

brycx commented 2 years ago

Yes, I also got annoyed by this earlier 👍