diff options
| author | Maybe Waffle <waffle.lapkin@gmail.com> | 2023-05-24 14:19:22 +0000 | 
|---|---|---|
| committer | Maybe Waffle <waffle.lapkin@gmail.com> | 2023-05-24 14:20:41 +0000 | 
| commit | fb0f74a8c9e8b8f488ec5894d5d314caebf4c662 (patch) | |
| tree | 4cab4cc84de840cc4cce01f3627a979fed59c54c /compiler/rustc_trait_selection/src/traits/coherence.rs | |
| parent | 70db8369226c4d2386b25d66a49c8989247934bf (diff) | |
| download | rust-fb0f74a8c9e8b8f488ec5894d5d314caebf4c662.tar.gz rust-fb0f74a8c9e8b8f488ec5894d5d314caebf4c662.zip | |
Use `Option::is_some_and` and `Result::is_ok_and` in the compiler
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits/coherence.rs')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/coherence.rs | 2 | 
1 files changed, 1 insertions, 1 deletions
| diff --git a/compiler/rustc_trait_selection/src/traits/coherence.rs b/compiler/rustc_trait_selection/src/traits/coherence.rs index 969e5fa64b0..aacbfbd3c87 100644 --- a/compiler/rustc_trait_selection/src/traits/coherence.rs +++ b/compiler/rustc_trait_selection/src/traits/coherence.rs @@ -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) | 
