Skip to content

Commit 7592c13

Browse files
committed
Simplify useless map_or
1 parent 8eae198 commit 7592c13

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

compiler/rustc_hir_analysis/src/coherence/inherent_impls_overlap.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,19 +140,19 @@ impl<'tcx> InherentOverlapChecker<'tcx> {
140140
impl1_def_id: DefId,
141141
impl2_def_id: DefId,
142142
) {
143-
traits::overlapping_impls(
143+
let maybe_overlap = traits::overlapping_impls(
144144
self.tcx,
145145
impl1_def_id,
146146
impl2_def_id,
147147
// We go ahead and just skip the leak check for
148148
// inherent impls without warning.
149149
SkipLeakCheck::Yes,
150150
overlap_mode,
151-
)
152-
.map_or(true, |overlap| {
151+
);
152+
153+
if let Some(overlap) = maybe_overlap {
153154
self.check_for_common_items_in_impls(impl1_def_id, impl2_def_id, overlap);
154-
false
155-
});
155+
}
156156
}
157157

158158
fn check_item(&mut self, id: hir::ItemId) {

0 commit comments

Comments
 (0)