-
Notifications
You must be signed in to change notification settings - Fork 73
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
Add eyre::Ok
#91
Add eyre::Ok
#91
Conversation
I'm struggling to understand the use case of this change, but I understand it's an anyhow feature you rely on and that somehow it works better with type inference when getting an Ok() at least though, and that compatibility with anyhow is worthwhile. A search returns many callsites and uses of Can you help me understand why you've specified Result::Ok() in a couple places and not others? I wouldn't think |
It's... been a while since I made this PR, so I've lost a lot of the context. If I remember right, my intent was to make sure that code that was using the function |
I appreciate you giving a second stab at it ^^; eyre has been a little out of water but there are a few more folks around now so we're pumping out the backlog! I think the actual conflict here was nothing, it just needed an auto-resolve and I finally got the workflow to work for that on my side : ) I'd really appreciate you checking that the actual types are correct and and not over or underspecified though. Good luck with this, if you get stuck you can feel free to ping me and ask for help! |
This is the error that wanted the Result::Ok(()) specification. I think that it figures out the type this way because |
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, shouldn't break anyone else's stuff unless they're using eyre::*
This PR is a backport of the
anyhow::Ok
function (dtolnay/anyhow#192). For motivation, consider the following minimal example:Without this
Ok
, function, the next best way to write line 2 would belet f = || Result::<_, eyre::Error>::Ok(());
, which is quite verbose!anyhow::Ok
is probably the biggest pain point I've had in the cases where I've usedeyre
in place ofanyhow
.