Fix handling of attributes applied to unit variant types (#152)
This commit is contained in:
parent
9464118c3a
commit
76427ef384
7 changed files with 109 additions and 28 deletions
|
@ -185,6 +185,21 @@ impl Attrs {
|
|||
}
|
||||
self
|
||||
}
|
||||
|
||||
pub fn is_default(&self) -> bool {
|
||||
match self {
|
||||
Self {
|
||||
with: None,
|
||||
title: None,
|
||||
description: None,
|
||||
deprecated: false,
|
||||
examples,
|
||||
repr: None,
|
||||
crate_name: None,
|
||||
} if examples.is_empty() => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn is_known_serde_or_validation_keyword(meta: &syn::Meta) -> bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue