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" {
|
} else if name == "auto_increment" {
|
||||||
if let Lit::Str(litstr) = &nv.lit {
|
if let Lit::Bool(litbool) = &nv.lit {
|
||||||
auto_increment = match litstr.value().as_str() {
|
auto_increment = litbool.value();
|
||||||
"true" => true,
|
|
||||||
"false" => false,
|
|
||||||
_ => {
|
|
||||||
return Err(Error::new(
|
|
||||||
field.span(),
|
|
||||||
format!(
|
|
||||||
"Invalid auto_increment = {}",
|
|
||||||
litstr.value()
|
|
||||||
),
|
|
||||||
))
|
|
||||||
}
|
|
||||||
};
|
|
||||||
} else {
|
} else {
|
||||||
return Err(Error::new(
|
return Err(Error::new(
|
||||||
field.span(),
|
field.span(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user