fix(napi): clippy error on 1.58

This commit is contained in:
LongYinan 2022-01-14 11:21:03 +08:00
parent 110f2196a4
commit 41bcd9c50b
No known key found for this signature in database
GPG key ID: C3666B7FC82ADAD7
3 changed files with 3 additions and 0 deletions

View file

@ -85,6 +85,7 @@ pub fn run<T: Task>(
})
}
#[allow(clippy::non_send_fields_in_send_ty)]
unsafe impl<T: Task> Send for AsyncWork<T> {}
unsafe impl<T: Task> Sync for AsyncWork<T> {}

View file

@ -11,6 +11,7 @@ pub struct Ref<T> {
pub(crate) raw_value: sys::napi_value,
}
#[allow(clippy::non_send_fields_in_send_ty)]
unsafe impl<T> Send for Ref<T> {}
unsafe impl<T> Sync for Ref<T> {}

View file

@ -15,6 +15,7 @@ pub struct FuturePromise<Data, Resolver: FnOnce(sys::napi_env, Data) -> Result<s
_data: PhantomData<Data>,
}
#[allow(clippy::non_send_fields_in_send_ty)]
unsafe impl<T, F: FnOnce(sys::napi_env, T) -> Result<sys::napi_value>> Send
for FuturePromise<T, F>
{