style(napi-derive): clippy fix (#1976)

This commit is contained in:
LongYinan 2024-02-25 00:54:33 +08:00 committed by GitHub
parent 71bbe0ef6f
commit 5af366b042
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -147,13 +147,15 @@ impl NapiFn {
..
}) = arguments
{
if let Some(syn::GenericArgument::Type(ty)) = angle_bracketed_args.first() {
if let syn::Type::Path(syn::TypePath { path, .. }) = ty {
if let Some(segment) = path.segments.first() {
if segment.ident.to_string() == parent.to_string() {
// If we have a Reference<A> in an impl A block, it shouldn't be an arg
return None;
}
if let Some(syn::GenericArgument::Type(syn::Type::Path(syn::TypePath {
path,
..
}))) = angle_bracketed_args.first()
{
if let Some(segment) = path.segments.first() {
if *parent == segment.ident {
// If we have a Reference<A> in an impl A block, it shouldn't be an arg
return None;
}
}
}