Skip to content

Commit 0f705bd

Browse files
committed
Convert if to match
1 parent c4f112a commit 0f705bd

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
@@ -436,17 +436,12 @@ impl<'tcx> FnCtxt<'_, 'tcx> {
436436
//
437437
// In practice currently the two ways that this happens is
438438
// coercion and subtyping.
439-
let (a, b) = if let ty::PredicateKind::Coerce(ty::CoercePredicate { a, b }) = atom {
440-
(a, b)
441-
} else if let ty::PredicateKind::Subtype(ty::SubtypePredicate {
442-
a_is_expected: _,
443-
a,
444-
b,
445-
}) = atom
446-
{
447-
(a, b)
448-
} else {
449-
return None;
439+
let (a, b) = match atom {
440+
ty::PredicateKind::Coerce(ty::CoercePredicate { a, b }) => (a, b),
441+
ty::PredicateKind::Subtype(ty::SubtypePredicate { a_is_expected: _, a, b }) => {
442+
(a, b)
443+
}
444+
_ => return None,
450445
};
451446

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

0 commit comments

Comments
 (0)