diff --git a/crates/neon-runtime/src/napi/fun.rs b/crates/neon-runtime/src/napi/fun.rs index 8cc8bdc46..f6a588bc1 100644 --- a/crates/neon-runtime/src/napi/fun.rs +++ b/crates/neon-runtime/src/napi/fun.rs @@ -9,7 +9,7 @@ use crate::raw::{Env, Local}; pub unsafe fn new(env: Env, name: &str, callback: F) -> Result where - F: Fn(Env, napi::CallbackInfo) -> Local + Send + 'static, + F: Fn(Env, napi::CallbackInfo) -> Local + 'static, { let mut out = MaybeUninit::uninit(); let data = Box::into_raw(Box::new(callback)); @@ -59,7 +59,7 @@ where unsafe extern "C" fn call_boxed(env: Env, info: napi::CallbackInfo) -> Local where - F: Fn(Env, napi::CallbackInfo) -> Local + Send + 'static, + F: Fn(Env, napi::CallbackInfo) -> Local + 'static, { let mut data = MaybeUninit::uninit(); let status = napi::get_cb_info( diff --git a/src/context/mod.rs b/src/context/mod.rs index 30ccd9c10..b50f9aa16 100644 --- a/src/context/mod.rs +++ b/src/context/mod.rs @@ -721,7 +721,7 @@ impl<'a> ModuleContext<'a> { /// Convenience method for exporting a Neon function from a module. pub fn export_function(&mut self, key: &str, f: F) -> NeonResult<()> where - F: Fn(FunctionContext) -> JsResult + Send + 'static, + F: Fn(FunctionContext) -> JsResult + 'static, V: Value, { let value = JsFunction::new(self, f)?.upcast::(); diff --git a/src/types/mod.rs b/src/types/mod.rs index aa2c54d96..111f109c7 100644 --- a/src/types/mod.rs +++ b/src/types/mod.rs @@ -746,7 +746,7 @@ impl JsFunction { pub fn new<'a, C, F, V>(cx: &mut C, f: F) -> JsResult<'a, JsFunction> where C: Context<'a>, - F: Fn(FunctionContext) -> JsResult + Send + 'static, + F: Fn(FunctionContext) -> JsResult + 'static, V: Value, { Self::new_internal(cx, f) @@ -756,7 +756,7 @@ impl JsFunction { fn new_internal<'a, C, F, V>(cx: &mut C, f: F) -> JsResult<'a, JsFunction> where C: Context<'a>, - F: Fn(FunctionContext) -> JsResult + Send + 'static, + F: Fn(FunctionContext) -> JsResult + 'static, V: Value, { use std::any;