mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-22 19:28:01 +00:00
fix(codegen): Take into account default=... when skip_deserializing
This commit is contained in:
@@ -437,7 +437,7 @@ fn deserialize_struct_as_seq(
|
||||
.map(|(i, &(_, ref attrs))| {
|
||||
let name = builder.id(format!("__field{}", i));
|
||||
if attrs.skip_deserializing_field() {
|
||||
let default = builder.expr().default();
|
||||
let default = attrs.expr_is_missing();
|
||||
quote_stmt!(cx,
|
||||
let $name = $default;
|
||||
).unwrap()
|
||||
@@ -1103,7 +1103,7 @@ fn deserialize_map(
|
||||
}
|
||||
},
|
||||
if attrs.skip_deserializing_field() {
|
||||
builder.expr().default()
|
||||
attrs.expr_is_missing()
|
||||
} else {
|
||||
builder.expr().id(name)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user