Skip to content

Commit e364c28

Browse files
committed
Use let instead of match to get value of enum with single variant.
1 parent 18c275b commit e364c28

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/librustc_mir/monomorphize/collector.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -824,11 +824,8 @@ fn find_vtable_types_for_unsizing<'tcx>(
824824
(&ty::Adt(source_adt_def, source_substs), &ty::Adt(target_adt_def, target_substs)) => {
825825
assert_eq!(source_adt_def, target_adt_def);
826826

827-
let kind = monomorphize::custom_coerce_unsize_info(tcx, source_ty, target_ty);
828-
829-
let coerce_index = match kind {
830-
CustomCoerceUnsized::Struct(i) => i,
831-
};
827+
let CustomCoerceUnsized::Struct(coerce_index) =
828+
monomorphize::custom_coerce_unsize_info(tcx, source_ty, target_ty);
832829

833830
let source_fields = &source_adt_def.non_enum_variant().fields;
834831
let target_fields = &target_adt_def.non_enum_variant().fields;

0 commit comments

Comments
 (0)