Merge pull request #969 from napi-rs/ignore-warning

fix(napi-derive): ignore warnings on generated fn
This commit is contained in:
LongYinan 2021-12-25 01:43:00 +08:00 committed by GitHub
commit cf69651701
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View file

@ -130,6 +130,8 @@ impl NapiEnum {
let js_mod_ident = js_mod_to_token_stream(self.js_mod.as_ref());
quote! {
#[allow(non_snake_case)]
#[allow(clippy::all)]
unsafe fn #callback_name(env: napi::bindgen_prelude::sys::napi_env) -> napi::bindgen_prelude::Result<napi::bindgen_prelude::sys::napi_value> {
use std::ffi::CString;
use std::ptr;

View file

@ -306,6 +306,8 @@ impl NapiFn {
Span::call_site(),
);
quote! {
#[allow(non_snake_case)]
#[allow(clippy::all)]
unsafe fn #cb_name(env: napi::bindgen_prelude::sys::napi_env) -> napi::bindgen_prelude::Result<napi::bindgen_prelude::sys::napi_value> {
let mut fn_ptr = std::ptr::null_mut();