Resolve conflict with pr 1115

This commit is contained in:
David Tolnay
2017-12-11 20:59:54 -08:00
parent 0c2e91f28a
commit 0dac13e4db
2 changed files with 31 additions and 0 deletions
+25
View File
@@ -673,7 +673,32 @@ fn deserialize_from_seq(
}
});
let this = &params.this;
let (_, ty_generics, _) = params.generics.split_for_impl();
let let_default = match *cattrs.default() {
attr::Default::Default => {
Some(
quote!(
let __default: #this #ty_generics = _serde::export::Default::default();
),
)
}
attr::Default::Path(ref path) => {
Some(
quote!(
let __default: #this #ty_generics = #path();
),
)
}
attr::Default::None => {
// We don't need the default value, to prevent an unused variable warning
// we'll leave the line empty.
None
}
};
quote_block! {
#let_default
#(#write_values)*
_serde::export::Ok(())
}