1
Fork 0

Rollup merge of #113084 - WaffleLapkin:less_map_or, r=Nilstrieb

Simplify some conditions

r? `@Nilstrieb`

Some things taken out of my `is_none_or` pr.
This commit is contained in:
Matthias Krüger 2023-06-27 22:10:15 +02:00 committed by GitHub
commit d505582ce2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 35 additions and 45 deletions

View file

@ -140,7 +140,7 @@ impl<'tcx> InherentOverlapChecker<'tcx> {
impl1_def_id: DefId,
impl2_def_id: DefId,
) {
traits::overlapping_impls(
let maybe_overlap = traits::overlapping_impls(
self.tcx,
impl1_def_id,
impl2_def_id,
@ -148,11 +148,11 @@ impl<'tcx> InherentOverlapChecker<'tcx> {
// inherent impls without warning.
SkipLeakCheck::Yes,
overlap_mode,
)
.map_or(true, |overlap| {
);
if let Some(overlap) = maybe_overlap {
self.check_for_common_items_in_impls(impl1_def_id, impl2_def_id, overlap);
false
});
}
}
fn check_item(&mut self, id: hir::ItemId) {