Convert if
to match
This commit is contained in:
parent
cfb2410752
commit
ff0bfea45f
@ -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)?;
|
||||
|
Loading…
Reference in New Issue
Block a user