Less indentiation in deserialize_from_body

This commit is contained in:
David Tolnay
2017-12-10 23:04:44 -08:00
parent ccae35d92a
commit 85e3ddc2b8
2 changed files with 22 additions and 14 deletions
+9
View File
@@ -164,6 +164,15 @@ pub enum Identifier {
Variant,
}
impl Identifier {
pub fn is_some(self) -> bool {
match self {
Identifier::No => false,
Identifier::Field | Identifier::Variant => true,
}
}
}
impl Container {
/// Extract out the `#[serde(...)]` attributes from an item.
pub fn from_ast(cx: &Ctxt, item: &syn::DeriveInput) -> Self {