Skip to content

Commit

Permalink
Simplify check for missing fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Mingun committed Aug 1, 2023
1 parent 3a3e6bf commit afe3872
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions serde_derive/src/de.rs
Expand Up @@ -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)
Expand Down Expand Up @@ -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>,
{
Expand Down

0 comments on commit afe3872

Please sign in to comment.