Simplify check for missing fields

This commit is contained in:
Mingun 2023-05-06 20:03:04 +05:00
parent 3a3e6bf103
commit afe3872810

View File

@ -1178,8 +1178,7 @@ fn deserialize_struct_in_place(
None,
));
let all_skipped = fields.iter().all(|field| field.attrs.skip_deserializing());
let visitor_var = if all_skipped {
let mut_seq = if field_names_idents.is_empty() {
quote!(_)
} else {
quote!(mut __seq)
@ -1230,7 +1229,7 @@ fn deserialize_struct_in_place(
}
#[inline]
fn visit_seq<__A>(self, #visitor_var: __A) -> _serde::__private::Result<Self::Value, __A::Error>
fn visit_seq<__A>(self, #mut_seq: __A) -> _serde::__private::Result<Self::Value, __A::Error>
where
__A: _serde::de::SeqAccess<#delife>,
{