From b4345d1375c85084514f33876427d5d071cc1518 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Wed, 24 Jan 2024 17:13:42 +0800 Subject: [PATCH] fix(napi): block_on type (#1911) --- crates/napi/src/tokio_runtime.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/napi/src/tokio_runtime.rs b/crates/napi/src/tokio_runtime.rs index 4728f6de..cf828a31 100644 --- a/crates/napi/src/tokio_runtime.rs +++ b/crates/napi/src/tokio_runtime.rs @@ -65,9 +65,9 @@ where /// Runs a future to completion /// This is blocking, meaning that it pauses other execution until the future is complete, /// only use it when it is absolutely necessary, in other places use async functions instead. -pub fn block_on(fut: F) -> F::Output +pub fn block_on(fut: F) -> F::Output where - F: 'static + Send + Future, + F: 'static + Send + Future, { RT.read().unwrap().as_ref().unwrap().block_on(fut) }