Skip to content

Commit

Permalink
Stop specifying lifetime parameters of delegated method
Browse files Browse the repository at this point in the history
  • Loading branch information
dewert99 committed Jul 18, 2024
1 parent 23d3b56 commit 0e8bb76
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ambassador/src/register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 0e8bb76

Please sign in to comment.