fix(napi): block_on type (#1911)
This commit is contained in:
parent
57bcee590b
commit
b4345d1375
1 changed files with 2 additions and 2 deletions
|
@ -65,9 +65,9 @@ where
|
||||||
/// Runs a future to completion
|
/// Runs a future to completion
|
||||||
/// This is blocking, meaning that it pauses other execution until the future is complete,
|
/// 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.
|
/// only use it when it is absolutely necessary, in other places use async functions instead.
|
||||||
pub fn block_on<F>(fut: F) -> F::Output
|
pub fn block_on<F, O>(fut: F) -> F::Output
|
||||||
where
|
where
|
||||||
F: 'static + Send + Future<Output = ()>,
|
F: 'static + Send + Future<Output = O>,
|
||||||
{
|
{
|
||||||
RT.read().unwrap().as_ref().unwrap().block_on(fut)
|
RT.read().unwrap().as_ref().unwrap().block_on(fut)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue