Fix validators bug
This commit is contained in:
parent
774f379709
commit
7f62b7d92c
|
@ -71,7 +71,7 @@ fn parse_nested_validator(
|
|||
let name = &nv.path;
|
||||
if let Lit::Str(value) = &nv.lit {
|
||||
let expr = syn::parse_str::<Expr>(&value.value())?;
|
||||
params.push(quote! { #name: #expr.into() });
|
||||
params.push(quote! { #name: (#expr).into() });
|
||||
} else {
|
||||
return Err(Error::new_spanned(
|
||||
&nv.lit,
|
||||
|
@ -137,7 +137,7 @@ pub fn parse_guards(crate_name: &TokenStream, args: &MetaList) -> Result<Option<
|
|||
params.push(quote! { #name: &#id });
|
||||
} else {
|
||||
let expr = syn::parse_str::<Expr>(&value_str)?;
|
||||
params.push(quote! { #name: #expr.into() });
|
||||
params.push(quote! { #name: (#expr).into() });
|
||||
}
|
||||
} else {
|
||||
return Err(Error::new_spanned(
|
||||
|
|
Loading…
Reference in New Issue
Block a user