More refactoring of proc macro...

This commit is contained in:
Graham Esau 2020-05-11 21:53:36 +01:00
parent 631120ead8
commit b1ded882b7
5 changed files with 421 additions and 419 deletions

View file

@ -54,10 +54,21 @@ impl<'a> Variant<'a> {
pub fn name(&self) -> String {
self.serde_attrs.name().deserialize_name()
}
pub fn is_unit(&self) -> bool {
match self.style {
serde_ast::Style::Unit => true,
_ => false,
}
}
}
impl<'a> Field<'a> {
pub fn name(&self) -> String {
self.serde_attrs.name().deserialize_name()
}
pub fn type_for_schema(&self) -> &syn::Type {
self.with.as_ref().unwrap_or(self.ty)
}
}