Skip to content

Commit e332270

Browse files
committed
fix(napi): future in block_on do not need to be send
1 parent 3cbae4e commit e332270

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

crates/napi/src/tokio_runtime.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,7 @@ where
6565
/// Runs a future to completion
6666
/// This is blocking, meaning that it pauses other execution until the future is complete,
6767
/// only use it when it is absolutely necessary, in other places use async functions instead.
68-
pub fn block_on<F, O>(fut: F) -> F::Output
69-
where
70-
F: 'static + Send + Future<Output = O>,
71-
{
68+
pub fn block_on<F: Future>(fut: F) -> F::Output {
7269
RT.read().unwrap().as_ref().unwrap().block_on(fut)
7370
}
7471

0 commit comments

Comments
 (0)