Skip to content

Commit

Permalink
fix(napi): future in block_on do not need to be send
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Jan 24, 2024
1 parent 3cbae4e commit e332270
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions crates/napi/src/tokio_runtime.rs
Expand Up @@ -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<F, O>(fut: F) -> F::Output
where
F: 'static + Send + Future<Output = O>,
{
pub fn block_on<F: Future>(fut: F) -> F::Output {
RT.read().unwrap().as_ref().unwrap().block_on(fut)
}

Expand Down

0 comments on commit e332270

Please sign in to comment.