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
{{ message }}
Repository navigation
Empty's Body impl Error = Infallible makes Empty::new() unable to be used w/ Body constraints #120
Empty has generic parameter for Data, so it would be nice to have a generic parameter for Error as well so that Empty::new() can be used w/ functions that set constraints on Body i.e B: Body<Error=..>
@juliusl
Does http_body_util::Empty::new().map_err(|_: Infallible| unreachable!()) solve your problem?
To explicitly specifying anyhow::Error, you can use .map_err::<_, anyhow::Error>(|_: Infallible| unreachable!())
Activity
nwtgck commentedon Aug 27, 2025
@juliusl
Does
http_body_util::Empty::new().map_err(|_: Infallible| unreachable!())solve your problem?To explicitly specifying
anyhow::Error, you can use.map_err::<_, anyhow::Error>(|_: Infallible| unreachable!())cgzones commentedon Nov 17, 2025
or just