Use Option::is_some_and and Result::is_ok_and in the compiler

This commit is contained in:
Maybe Waffle
2023-05-24 14:19:22 +00:00
parent 70db836922
commit fb0f74a8c9
87 changed files with 148 additions and 158 deletions

View File

@@ -706,7 +706,7 @@ impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for OrphanChecker<'tcx> {
}
ty::Dynamic(tt, ..) => {
let principal = tt.principal().map(|p| p.def_id());
if principal.map_or(false, |p| self.def_id_is_local(p)) {
if principal.is_some_and(|p| self.def_id_is_local(p)) {
ControlFlow::Break(OrphanCheckEarlyExit::LocalTy(ty))
} else {
self.found_non_local_ty(ty)