Use let else here

This commit is contained in:
Santiago Pastorino 2022-03-17 14:55:16 -03:00
parent 9c076f3f90
commit ba8b4a4f82
No known key found for this signature in database
GPG Key ID: 8131A24E0C79EFAF

View File

@ -387,7 +387,10 @@ fn resolve_negative_obligation<'cx, 'tcx>(
) -> bool {
let tcx = infcx.tcx;
if let Some(o) = o.flip_polarity(tcx) {
let Some(o) = o.flip_polarity(tcx) else {
return false;
};
let mut fulfillment_cx = FulfillmentContext::new();
fulfillment_cx.register_predicate_obligation(infcx, o);
@ -419,10 +422,7 @@ fn resolve_negative_obligation<'cx, 'tcx>(
return false;
}
return true;
}
false
true
}
pub fn trait_ref_is_knowable<'tcx>(