style(napi): clippy fix (#1815)

This commit is contained in:
LongYinan 2023-11-17 20:42:53 +08:00 committed by GitHub
parent 9d62db47e8
commit 6a1943ba54
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View file

@ -41,12 +41,10 @@ impl ToTypeDef for NapiImpl {
self.name.to_string(),
if resolved_type == "undefined" {
"void".to_owned()
} else {
if is_optional {
} else if is_optional {
format!("{} | null", resolved_type)
} else {
resolved_type
}
},
);
});

View file

@ -34,7 +34,7 @@ impl ToNapiValue for &String {
impl ToNapiValue for String {
#[inline]
unsafe fn to_napi_value(env: sys::napi_env, val: Self) -> Result<sys::napi_value> {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
unsafe {
ToNapiValue::to_napi_value(env, &val)
}