Skip to content

Commit b58e8ba

Browse files
committed
Replace if let Some(...) = ... to Option::map
1 parent ada50b0 commit b58e8ba

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

serde_derive/src/de.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,13 +1247,10 @@ fn prepare_enum_variant_enum(
12471247
}
12481248
};
12491249

1250-
let fallthrough = if let Some(other_idx) = other_idx {
1250+
let fallthrough = other_idx.map(|other_idx| {
12511251
let ignore_variant = variant_names_idents[other_idx].1.clone();
1252-
let fallthrough = quote!(_serde::__private::Ok(__Field::#ignore_variant));
1253-
Some(fallthrough)
1254-
} else {
1255-
None
1256-
};
1252+
quote!(_serde::__private::Ok(__Field::#ignore_variant))
1253+
});
12571254

12581255
let variant_visitor = Stmts(deserialize_generated_identifier(
12591256
&variant_names_idents,

0 commit comments

Comments
 (0)