Fix auto_increment as boolean
This commit is contained in:
parent
fa02a45fbf
commit
5567fbc289
@ -100,20 +100,8 @@ pub fn expand_derive_entity_model(data: Data, attrs: Vec<Attribute>) -> syn::Res
|
||||
));
|
||||
}
|
||||
} else if name == "auto_increment" {
|
||||
if let Lit::Str(litstr) = &nv.lit {
|
||||
auto_increment = match litstr.value().as_str() {
|
||||
"true" => true,
|
||||
"false" => false,
|
||||
_ => {
|
||||
return Err(Error::new(
|
||||
field.span(),
|
||||
format!(
|
||||
"Invalid auto_increment = {}",
|
||||
litstr.value()
|
||||
),
|
||||
))
|
||||
}
|
||||
};
|
||||
if let Lit::Bool(litbool) = &nv.lit {
|
||||
auto_increment = litbool.value();
|
||||
} else {
|
||||
return Err(Error::new(
|
||||
field.span(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user