From d7b441fe50d89d0701e6ee37268a1a3a67583dc7 Mon Sep 17 00:00:00 2001 From: dxx <1827939333@qq.com> Date: Thu, 8 Apr 2021 14:28:46 +0800 Subject: [PATCH] Fix error caused by empty string --- codegen/src/util.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/codegen/src/util.rs b/codegen/src/util.rs index 0890b23..5fa187c 100644 --- a/codegen/src/util.rs +++ b/codegen/src/util.rs @@ -137,7 +137,9 @@ pub fn parse_args(sig: &mut syn::Signature) -> Result, syn::Error> { // A literal, like the `"name"` in `#[param("name")]` syn::NestedMeta::Lit(lit) => { if let syn::Lit::Str(lit) = lit { - name = lit.value(); + if !lit.value().is_empty() { + name = lit.value(); + } } }, _=> {