From 8325670857c87c78b6a7db528686d1fdedd4ac7d Mon Sep 17 00:00:00 2001 From: fankaiLiu <93850567+fankaiLiu@users.noreply.github.com> Date: Fri, 24 Nov 2023 02:10:34 +0800 Subject: [PATCH] Resolving endpoint Macro Expansion Errors (#506) * Implement ToSchema for PhantomData * Add introduction of salvo-cli * Optimization: take an uncommon name to avoid bugs with the same name as the user's * Fix the code, pass the test * Resolving Macro Expansion Errors --- crates/oapi-macros/src/endpoint/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/oapi-macros/src/endpoint/mod.rs b/crates/oapi-macros/src/endpoint/mod.rs index 95b10d027..26aae10c7 100644 --- a/crates/oapi-macros/src/endpoint/mod.rs +++ b/crates/oapi-macros/src/endpoint/mod.rs @@ -167,7 +167,7 @@ fn handle_fn(salvo: &Ident, oapi: &Ident, sig: &Signature) -> syn::Result<(Token for input in &sig.inputs { match parse_input_type(input) { InputType::Request(_pat) => { - call_args.push(Ident::new("req", Span::call_site())); + call_args.push(Ident::new("__macro_generated_req", Span::call_site())); } InputType::Depot(_pat) => { call_args.push(Ident::new("depot", Span::call_site()));