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; } } }