From 74cd9c49c2d015a0f2c0a514aee78be30c1c006e Mon Sep 17 00:00:00 2001 From: Michael Orenstein Date: Sun, 26 Jul 2020 17:46:45 +0930 Subject: [PATCH] Fixed documentation of threadsafe functions --- napi/src/threadsafe_function.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/napi/src/threadsafe_function.rs b/napi/src/threadsafe_function.rs index 2083eee2..78d43671 100644 --- a/napi/src/threadsafe_function.rs +++ b/napi/src/threadsafe_function.rs @@ -45,12 +45,10 @@ pub trait ToJs: Copy + Clone { /// /// impl ToJs for HandleNumber { /// type Output = u8; -/// type JsValue = JsNumber; /// -/// fn resolve(&self, env: &mut Env, output: Self::Output) -> Result<(u64, Self::JsValue)> { -/// let argv: u64 = 1; -/// let value = env.create_uint32(output as u32)?; -/// Ok((argv, value)) +/// fn resolve(&self, env: &mut Env, output: Self::Output) -> Result> { +/// let value = env.create_uint32(output as u32)?.into_unknown()?; +/// Ok(vec![value]) /// } /// } ///