Skip to content

Commit

Permalink
Fix error caused by empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
dxx committed Apr 8, 2021
1 parent 46a5cb7 commit d7b441f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion codegen/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ pub fn parse_args(sig: &mut syn::Signature) -> Result<Vec<ReqArg>, 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();
}
}
},
_=> {
Expand Down

0 comments on commit d7b441f

Please sign in to comment.