macro: fixup: don't create unwanted default impl snippets

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2019-07-19 15:20:45 +02:00
parent 8523e03486
commit 5d9fe0d24d

View File

@ -584,9 +584,11 @@ fn handle_struct_named(
}
});
default_impl.extend(quote_spanned! { field_span =>
#field_ident: #default.into(),
});
if derive_default {
default_impl.extend(quote_spanned! { field_span =>
#field_ident: #default.into(),
});
}
} else {
if derive_default {
default_impl.extend(quote_spanned! { field_span =>