Skip to content

Commit 23277a5

Browse files
committed
Simplify conditional erroring
1 parent 4661c83 commit 23277a5

File tree

1 file changed

+1
-5
lines changed
  • compiler/rustc_hir_analysis/src/coherence

1 file changed

+1
-5
lines changed

Diff for: compiler/rustc_hir_analysis/src/coherence/builtin.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,7 @@ impl<'tcx> Checker<'tcx> {
5757
where
5858
F: FnMut(TyCtxt<'tcx>, LocalDefId) -> Result<(), ErrorGuaranteed>,
5959
{
60-
let mut res = Ok(());
61-
if Some(self.trait_def_id) == trait_def_id {
62-
res = res.and(f(self.tcx, self.impl_def_id));
63-
}
64-
res
60+
if Some(self.trait_def_id) == trait_def_id { f(self.tcx, self.impl_def_id) } else { Ok(()) }
6561
}
6662
}
6763

0 commit comments

Comments
 (0)