fix(napi): future in block_on do not need to be send

This commit is contained in:
LongYinan 2024-01-24 17:20:31 +08:00
parent 3cbae4e8c1
commit e332270698
No known key found for this signature in database
GPG key ID: C3666B7FC82ADAD7

View file

@ -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)
}