From 604b6f72a6b0e411ca810604895b0368885e2f47 Mon Sep 17 00:00:00 2001 From: Luqman Aden Date: Sat, 19 Feb 2022 14:38:31 -0800 Subject: [PATCH] Mark upgrade as async fn instead of returning impl Future. --- src/async_impl/upgrade.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 } }