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 May 6, 2023
1 parent 2bc544c commit 7f01673
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions serde_derive/src/de.rs
Expand Up @@ -1100,8 +1100,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 @@ -1152,7 +1151,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 7f01673

Please sign in to comment.