From e3408067cc146d7039d2a01333638ba9c4446c3c Mon Sep 17 00:00:00 2001 From: Yusuke Tanaka Date: Fri, 10 Mar 2023 11:28:51 +0900 Subject: refactor: use `pin!` macro from std (#18110) This commit replaces `pin_mut!` macro with `pin!` macro that has been provided from std since Rust 1.68.0. With the std version we can not only expect its stability but also pass an expression (rather than identifier) as an argument to the macro. --- ext/http/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ext/http/lib.rs') diff --git a/ext/http/lib.rs b/ext/http/lib.rs index 8fd7015aa..31b76cf44 100644 --- a/ext/http/lib.rs +++ b/ext/http/lib.rs @@ -14,7 +14,6 @@ use deno_core::futures::future::Pending; use deno_core::futures::future::RemoteHandle; use deno_core::futures::future::Shared; use deno_core::futures::never::Never; -use deno_core::futures::pin_mut; use deno_core::futures::ready; use deno_core::futures::stream::Peekable; use deno_core::futures::FutureExt; @@ -62,6 +61,7 @@ use std::io; use std::io::Write; use std::mem::replace; use std::mem::take; +use std::pin::pin; use std::pin::Pin; use std::rc::Rc; use std::sync::Arc; @@ -156,8 +156,8 @@ impl HttpConnResource { // A local task that polls the hyper connection future to completion. let task_fut = async move { - pin_mut!(shutdown_fut); - pin_mut!(conn_fut); + let conn_fut = pin!(conn_fut); + let shutdown_fut = pin!(shutdown_fut); let result = match select(conn_fut, shutdown_fut).await { Either::Left((result, _)) => result, Either::Right((_, mut conn_fut)) => { -- cgit v1.2.3