More refactoring of proc macro...
This commit is contained in:
parent
631120ead8
commit
b1ded882b7
5 changed files with 421 additions and 419 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue