Replace if let Some(...) = ... to Option::map

This commit is contained in:
Mingun 2020-10-16 21:36:25 +05:00
parent ada50b077e
commit b58e8bac12

View File

@ -1247,13 +1247,10 @@ fn prepare_enum_variant_enum(
}
};
let fallthrough = if let Some(other_idx) = other_idx {
let fallthrough = other_idx.map(|other_idx| {
let ignore_variant = variant_names_idents[other_idx].1.clone();
let fallthrough = quote!(_serde::__private::Ok(__Field::#ignore_variant));
Some(fallthrough)
} else {
None
};
quote!(_serde::__private::Ok(__Field::#ignore_variant))
});
let variant_visitor = Stmts(deserialize_generated_identifier(
&variant_names_idents,