Convert if to match

This commit is contained in:
Maybe Waffle 2024-04-14 18:06:59 +00:00 committed by Waffle Lapkin
parent cfb2410752
commit ff0bfea45f

View File

@ -436,17 +436,12 @@ fn create_coercion_graph(&self) -> VecGraph<ty::TyVid> {
//
// In practice currently the two ways that this happens is
// coercion and subtyping.
let (a, b) = if let ty::PredicateKind::Coerce(ty::CoercePredicate { a, b }) = atom {
(a, b)
} else if let ty::PredicateKind::Subtype(ty::SubtypePredicate {
a_is_expected: _,
a,
b,
}) = atom
{
(a, b)
} else {
return None;
let (a, b) = match atom {
ty::PredicateKind::Coerce(ty::CoercePredicate { a, b }) => (a, b),
ty::PredicateKind::Subtype(ty::SubtypePredicate { a_is_expected: _, a, b }) => {
(a, b)
}
_ => return None,
};
let a_vid = self.root_vid(a)?;