-
Notifications
You must be signed in to change notification settings - Fork 23
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
It is hard to use metered with a wrapped error #43
Comments
I think a possible solution would be to change the signature to
someone with a |
This would be a breaking change, but happy to consider a PR for this |
Cool. One simplification I found is that in order to get Metered, it is sufficient to implement OnResultMut, so we can leave the interface of OnResult unchanged. A complication is that we want to support any R, not just a Result<T, E>, so we cannot assume as_ref(). With the above what I did was change OnResultMut to take an R by value and return a new one. The changes are pretty small. I will open PRs. |
If you have
It is hard to use it with a function like:
I did manage to write
WrappedMetric
, but had to require that T implements default. The full code is:The text was updated successfully, but these errors were encountered: