style: clippy fix

This commit is contained in:
LongYinan 2021-11-25 23:35:50 +08:00
parent aaf1bd14ea
commit c365c15639
No known key found for this signature in database
GPG key ID: C3666B7FC82ADAD7

View file

@ -264,8 +264,7 @@ impl NapiFn {
quote! {
<#ty as napi::bindgen_prelude::ToNapiValue>::to_napi_value(env, #ret)
}
} else {
if is_return_self {
} else if is_return_self {
quote! { #ret.map(|_| cb.this) }
} else {
quote! {
@ -278,16 +277,13 @@ impl NapiFn {
}
}
}
}
} else {
if is_return_self {
} else if is_return_self {
quote! { Ok(cb.this) }
} else {
quote! {
<#ty as napi::bindgen_prelude::ToNapiValue>::to_napi_value(env, #ret)
}
}
}
} else {
quote! {
<() as napi::bindgen_prelude::ToNapiValue>::to_napi_value(env, ())