You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 (theFuture::Output
will always beResult::Ok
), but since for exampletokio
currently requires spawned futures to have a unit error this would be unergonomic.The text was updated successfully, but these errors were encountered: