1
Fork 0

Simplify some conditions

This commit is contained in:
Maybe Waffle 2023-06-27 07:40:47 +00:00
parent 97bf23d26b
commit ef05533c39
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) {