From f76a12eb5a2611c523403c8ba3c52bc3a6f30618 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Sat, 25 Dec 2021 01:23:38 +0800 Subject: [PATCH] fix(napi-derive): ignore warnings on generated fn Close https://github.com/napi-rs/napi-rs/issues/968 --- crates/backend/src/codegen/enum.rs | 2 ++ crates/backend/src/codegen/fn.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/crates/backend/src/codegen/enum.rs b/crates/backend/src/codegen/enum.rs index f85210f3..57aa2515 100644 --- a/crates/backend/src/codegen/enum.rs +++ b/crates/backend/src/codegen/enum.rs @@ -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 { use std::ffi::CString; use std::ptr; diff --git a/crates/backend/src/codegen/fn.rs b/crates/backend/src/codegen/fn.rs index 480a0b93..fed1373e 100644 --- a/crates/backend/src/codegen/fn.rs +++ b/crates/backend/src/codegen/fn.rs @@ -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 { let mut fn_ptr = std::ptr::null_mut();