diff --git a/src/async_impl/upgrade.rs b/src/async_impl/upgrade.rs index 5b9cf12a5..4a69b4db5 100644 --- a/src/async_impl/upgrade.rs +++ b/src/async_impl/upgrade.rs @@ -64,9 +64,10 @@ impl From for Upgraded { impl super::response::Response { /// Consumes the response and returns a future for a possible HTTP upgrade. - pub fn upgrade(self) -> impl futures_core::Future> { + pub async fn upgrade(self) -> crate::Result { hyper::upgrade::on(self.res) .map_ok(Upgraded::from) .map_err(crate::error::upgrade) + .await } }