From 0e8bb761e8c6ef3971cdad939619fa7719ca07f6 Mon Sep 17 00:00:00 2001 From: dewert99 Date: Thu, 18 Jul 2024 11:37:00 -0700 Subject: [PATCH] Stop specifying lifetime parameters of delegated method --- ambassador/src/register.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ambassador/src/register.rs b/ambassador/src/register.rs index a2123c5..7a44467 100644 --- a/ambassador/src/register.rs +++ b/ambassador/src/register.rs @@ -343,14 +343,18 @@ fn build_method_invocation( }) .collect(); - let generics = method_sig.generics.split_for_impl().1; - let turbofish = generics.as_turbofish(); + let generics = method_sig.generics.params.iter().filter_map(|x| match x { + GenericParam::Type(t) => Some(&t.ident), + GenericParam::Lifetime(_) => None, + GenericParam::Const(c) => Some(&c.ident), + }); let post = if original_method.sig.asyncness.is_some() { quote!(.await) } else { quote!() }; - let method_invocation = quote! { #field_ident.#method_ident #turbofish(#argument_list) #post }; + let method_invocation = + quote! { #field_ident.#method_ident::<#(#generics,)*>(#argument_list) #post }; method_invocation }