refactor: remove 1 level of nesting

This commit is contained in:
Nik Revenco
2025-10-17 18:29:26 +01:00
parent 4e278703c6
commit 086353c581
+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();