Skip to content
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 .uninhabited_error() next to .unit_error() #1399

Closed
PvdBerg1998 opened this issue Jan 6, 2019 · 0 comments · Fixed by #1492
Closed

Add .uninhabited_error() next to .unit_error() #1399

PvdBerg1998 opened this issue Jan 6, 2019 · 0 comments · Fixed by #1492

Comments

@PvdBerg1998
Copy link

I recently rewrote my code to use futures 0.3. One of the issues I ran into was that hyper requires a future 0.1 where the error type implements std::error::Error. The natural solution to this would be to use .unit_error(), but this does not implement the required trait.

For my own purposes I basically copy-pasted the implementation of UnitError, but with the error type set to !, which implements every trait.

I would suggest deprecating .unit_error() in favour of .uninhabited_error() since it's more representative of what is actually happening (the Future::Output will always be Result::Ok), but since for example tokio currently requires spawned futures to have a unit error this would be unergonomic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant