Conversation
ncalexan
left a comment
There was a problem hiding this comment.
This looks basically like I'd expect. I think we should do a little duplication (declare Result<T>, duplicate bail!) to minimize the initial changes, and then we can decide if we want to drop bail!.
I'll look at doing the db crate, which needs a lot of love to declare non-string errors anyway.
| ErrorKind, | ||
| Result, | ||
| }; | ||
| use errors::AlgebrizerError; |
There was a problem hiding this comment.
I'm not against declaring Result<T> = std::result::Result<T, errors::AlgebrizerError> to reduce the changes. Or even implementing bail! in each crate -- it's easy.
The Err(...)? pattern is odd to me -- I prefer the return Err(...) expression.
There was a problem hiding this comment.
Using ? adds an implicit into to do conversion of errors, which is a little more compact than return Err(some_err.into()) or return some_result.map_err(|e| e.into()).
44e1e55 to
caac84e
Compare
|
This is bulk of the work. Needs another cleanup pass, and rebasing on top of |
3368a08 to
3e06a2b
Compare
|
Tests pass! I'm not super happy with how parts of this turned out, but it's not a good idea to let this fall behind the other work. We can iterate on the particulars once/if we hit problems along the line. |
|
@ncalexan do you mind giving this a lookover before I have to rebase it again? 😭 |
This is an early WIP to get feedback.
So far the only non-mechanical bit was conversion of
InvalidBinding, since it wraps aBindingError.Eventually fixes #586.