-
-
Notifications
You must be signed in to change notification settings - Fork 68
util: Add Either util
#64
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
Conversation
|
This just my opinion but I don't think we need all the other impls, just Same goes for all the helper methods on |
|
I see. Currently, this implements |
|
I think we should use |
|
Thanks for the hint. That makes a lot of sense. I have implemented your suggestions. |
|
Cool, I think if you update my one nit then we can merge this. Thanks! |
|
Awesome 🎉, I am probably going to be able to apply your suggestions by tomorrow. |
This PR introduces a new type,
Either, as discussed in #59.Eitherimplements:std::error::Errorbytes::Bufhttp_body::BodyFrom<Result<L, R>>Eitheralso provides some methods like:flip(),map_left(),map_right(),map(),either(),as_ref(),into_inner().Due to the limitations of
pin-project-litethis PR does not use thepin_project!macro but instead uses a slightly adjusted expanded version.This change is entirely backward compatible.