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