Store flatten flag in container attributes

This commit is contained in:
Jan Michael Auer
2018-03-15 14:30:38 +01:00
committed by Armin Ronacher
parent 571bb8caed
commit 5ae06bba49
3 changed files with 17 additions and 7 deletions
+5 -1
View File
@@ -48,7 +48,7 @@ pub enum Style {
impl<'a> Container<'a> {
pub fn from_ast(cx: &Ctxt, item: &'a syn::DeriveInput) -> Container<'a> {
let attrs = attr::Container::from_ast(cx, item);
let mut attrs = attr::Container::from_ast(cx, item);
let mut data = match item.data {
syn::Data::Enum(ref data) => {
@@ -85,6 +85,10 @@ impl<'a> Container<'a> {
found #[serde(repr = \"{}\")]", attrs.repr()));
}
if has_flatten {
attrs.mark_has_flatten();
}
let item = Container {
ident: item.ident,
attrs: attrs,