Merge pull request #3001 from nik-contrib/refactor

refactor: remove 1 level of nesting
This commit is contained in:
David Tolnay
2025-10-17 10:35:18 -07:00
committed by GitHub
+3 -5
View File
@@ -1185,13 +1185,11 @@ impl Field {
} }
} }
// Is skip_deserializing, initialize the field to Default::default() unless a // If skip_deserializing, initialize the field to Default::default() unless a
// different default is specified by `#[serde(default = "...")]` on // different default is specified by `#[serde(default = "...")]` on
// ourselves or our container (e.g. the struct we are in). // ourselves or our container (e.g. the struct we are in).
if let Default::None = *container_default { if container_default.is_none() && skip_deserializing.0.value.is_some() {
if skip_deserializing.0.value.is_some() { default.set_if_none(Default::Default);
default.set_if_none(Default::Default);
}
} }
let mut borrowed_lifetimes = borrowed_lifetimes.get().unwrap_or_default(); let mut borrowed_lifetimes = borrowed_lifetimes.get().unwrap_or_default();