From e3322706981414dbdbde0a5021cab1d5f9144620 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Wed, 24 Jan 2024 17:20:31 +0800 Subject: [PATCH] fix(napi): future in block_on do not need to be send --- crates/napi/src/tokio_runtime.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/crates/napi/src/tokio_runtime.rs b/crates/napi/src/tokio_runtime.rs index f7728b39..3074ba70 100644 --- a/crates/napi/src/tokio_runtime.rs +++ b/crates/napi/src/tokio_runtime.rs @@ -65,10 +65,7 @@ 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 -where - F: 'static + Send + Future, -{ +pub fn block_on(fut: F) -> F::Output { RT.read().unwrap().as_ref().unwrap().block_on(fut) }