Use if-let guards in the codebase

This commit is contained in:
Léo Lanteri Thauvin
2021-08-16 17:29:49 +02:00
parent a992a11913
commit fde1b76b4b
27 changed files with 242 additions and 254 deletions

View File

@@ -225,14 +225,12 @@ impl<'tcx> TyCtxt<'tcx> {
}
}
ty::Tuple(tys) => {
if let Some((&last_ty, _)) = tys.split_last() {
ty = last_ty.expect_ty();
} else {
break;
}
ty::Tuple(tys) if let Some((&last_ty, _)) = tys.split_last() => {
ty = last_ty.expect_ty();
}
ty::Tuple(_) => break,
ty::Projection(_) | ty::Opaque(..) => {
let normalized = normalize(ty);
if ty == normalized {