From 5af366b042cfb83ba1cdf078a5d3593c03051e2f Mon Sep 17 00:00:00 2001 From: LongYinan Date: Sun, 25 Feb 2024 00:54:33 +0800 Subject: [PATCH] style(napi-derive): clippy fix (#1976) --- crates/backend/src/typegen/fn.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/crates/backend/src/typegen/fn.rs b/crates/backend/src/typegen/fn.rs index 5fd6be9e..41852140 100644 --- a/crates/backend/src/typegen/fn.rs +++ b/crates/backend/src/typegen/fn.rs @@ -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 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 in an impl A block, it shouldn't be an arg + return None; } } }