Skip to content

Commit 7c653c9

Browse files
committed
Convert if to match
1 parent fa134b5 commit 7c653c9

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

compiler/rustc_hir_typeck/src/fallback.rs

+6-11
Original file line numberDiff line numberDiff line change
@@ -439,17 +439,12 @@ impl<'tcx> FnCtxt<'_, 'tcx> {
439439
//
440440
// In practice currently the two ways that this happens is
441441
// coercion and subtyping.
442-
let (a, b) = if let ty::PredicateKind::Coerce(ty::CoercePredicate { a, b }) = atom {
443-
(a, b)
444-
} else if let ty::PredicateKind::Subtype(ty::SubtypePredicate {
445-
a_is_expected: _,
446-
a,
447-
b,
448-
}) = atom
449-
{
450-
(a, b)
451-
} else {
452-
return None;
442+
let (a, b) = match atom {
443+
ty::PredicateKind::Coerce(ty::CoercePredicate { a, b }) => (a, b),
444+
ty::PredicateKind::Subtype(ty::SubtypePredicate { a_is_expected: _, a, b }) => {
445+
(a, b)
446+
}
447+
_ => return None,
453448
};
454449

455450
let a_vid = self.root_vid(a)?;

0 commit comments

Comments
 (0)