refactor: replace futures_util pin and tokio_pin with std pin (#8109)

This commit is contained in:
jn
2024-05-06 03:14:54 -07:00
committed by GitHub
parent 199503531c
commit 8f8b29b3ce
8 changed files with 32 additions and 28 deletions

View File

@ -19,12 +19,12 @@ use crate::{
use dyn_clone::DynClone;
use futures_util::{
future::{select, BoxFuture},
pin_mut, Future, FutureExt, TryFutureExt,
Future, FutureExt, TryFutureExt,
};
use std::{
any::Any,
fmt::{Display, Formatter},
pin::Pin,
pin::{pin, Pin},
sync::{
atomic::{AtomicUsize, Ordering},
Arc,
@ -334,7 +334,7 @@ impl TaskExecutor {
async move {
// Create an instance of IncCounterOnDrop with the counter to increment
let _inc_counter_on_drop = IncCounterOnDrop::new(finished_regular_tasks_metrics);
pin_mut!(fut);
let fut = pin!(fut);
let _ = select(on_shutdown, fut).await;
}
}
@ -409,7 +409,7 @@ impl TaskExecutor {
let task = async move {
// Create an instance of IncCounterOnDrop with the counter to increment
let _inc_counter_on_drop = IncCounterOnDrop::new(finished_critical_tasks_metrics);
pin_mut!(task);
let task = pin!(task);
let _ = select(on_shutdown, task).await;
};