Skip to content

Commit

Permalink
ignore_variant variable is always None, let's take this into account
Browse files Browse the repository at this point in the history
  • Loading branch information
Mingun committed Aug 6, 2023
1 parent 5e313a7 commit ada50b0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions serde_derive/src/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1247,19 +1247,19 @@ fn prepare_enum_variant_enum(
}
};

let (ignore_variant, fallthrough) = if let Some(other_idx) = other_idx {
let fallthrough = if let Some(other_idx) = other_idx {
let ignore_variant = variant_names_idents[other_idx].1.clone();
let fallthrough = quote!(_serde::__private::Ok(__Field::#ignore_variant));
(None, Some(fallthrough))
Some(fallthrough)
} else {
(None, None)
None
};

let variant_visitor = Stmts(deserialize_generated_identifier(
&variant_names_idents,
cattrs,
true,
ignore_variant,
None,
fallthrough,
));

Expand Down

0 comments on commit ada50b0

Please sign in to comment.