-
Notifications
You must be signed in to change notification settings - Fork 127
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
refactor!: migrate from thiserror
to snafu
#181
refactor!: migrate from thiserror
to snafu
#181
Conversation
Thanks for the PR! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the big effort on this! I appreciate the attention to detail.
One small change about the std
feature. I think the solution is to simply drop the last commit, and it will be good. I'll add an equivalent change in my next 1 or 2 PRs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, LGTM - obviously Jay's suggestion will help with the failing CI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Looks like you need to rebase and resolve some conflict with main. I'll need to re-approve once you do that, but it should be good once you do.
🎉 This PR is included in version 0.25.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Rationale for this change
This PR should close #174.
What changes are included in this PR?
NOTE: the individual commits may be good to review individually.
snafu
does not support tuple structs.#[derive(Error)]
is substituted with the analogous#[derive(Snafu)]
. In particular:#[error(...)]
attributes are substituted with equivalent#[snafu(display(...))]
attributes#[error(transparent)]
attributes are substituted with equivalent#[snafu(transparent)]
attributes (which also derive the correspondingFrom
implementation)ConversionError::TimestampConversionError
, the#[snafu(context(false), display(...))]
attribute is used for deriving aFrom
implementation, and at the same time maintain the custom error messagestd
feature is introduced for theproof-of-sql
crate, which in turns activates thesnafu/std
feature. Thestd
feature is required for theposql_db
example, becauseClap
relies on thestd::error::Error
trait.thiserror
still appears in the dependency tree (cargo tree -i thiserror
), but only as a transitive dependency (viablitzar
, and dev-dependencies)Are these changes tested?
Yes. This PR is a refactoring, and all existing tests pass.