From ada50b077e1ea0d573209823cba2afd0f5494a43 Mon Sep 17 00:00:00 2001 From: Mingun Date: Fri, 16 Oct 2020 21:33:22 +0500 Subject: [PATCH] ignore_variant variable is always None, let's take this into account --- serde_derive/src/de.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/serde_derive/src/de.rs b/serde_derive/src/de.rs index cfbdfd63..dfdb8a25 100644 --- a/serde_derive/src/de.rs +++ b/serde_derive/src/de.rs @@ -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, ));