Resolve conflict with pr 1115
This commit is contained in:
parent
0c2e91f28a
commit
0dac13e4db
@ -673,7 +673,32 @@ fn deserialize_from_seq(
|
||||
}
|
||||
});
|
||||
|
||||
let this = ¶ms.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(())
|
||||
}
|
||||
|
@ -86,6 +86,12 @@ struct StructSkipDefault {
|
||||
#[serde(skip_deserializing)] a: i32,
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Debug, Deserialize)]
|
||||
#[serde(default)]
|
||||
struct StructSkipDefaultGeneric<T> {
|
||||
#[serde(skip_deserializing)] t: T,
|
||||
}
|
||||
|
||||
impl Default for StructSkipDefault {
|
||||
fn default() -> Self {
|
||||
StructSkipDefault {
|
||||
|
Loading…
Reference in New Issue
Block a user