Skip to content

Commit

Permalink
Mark upgrade as async fn instead of returning impl Future.
Browse files Browse the repository at this point in the history
  • Loading branch information
luqmana committed Feb 19, 2022
1 parent f3c3b05 commit f6d6e3d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/async_impl/upgrade.rs
Expand Up @@ -64,9 +64,10 @@ impl From<hyper::upgrade::Upgraded> 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<Output = crate::Result<Upgraded>> {
pub async fn upgrade(self) -> crate::Result<Upgraded> {
hyper::upgrade::on(self.res)
.map_ok(Upgraded::from)
.map_err(crate::error::upgrade)
.await
}
}

0 comments on commit f6d6e3d

Please sign in to comment.