Simplify conditional erroring
This commit is contained in:
parent
4661c83530
commit
23277a502e
1 changed files with 1 additions and 5 deletions
|
@ -57,11 +57,7 @@ impl<'tcx> Checker<'tcx> {
|
|||
where
|
||||
F: FnMut(TyCtxt<'tcx>, LocalDefId) -> Result<(), ErrorGuaranteed>,
|
||||
{
|
||||
let mut res = Ok(());
|
||||
if Some(self.trait_def_id) == trait_def_id {
|
||||
res = res.and(f(self.tcx, self.impl_def_id));
|
||||
}
|
||||
res
|
||||
if Some(self.trait_def_id) == trait_def_id { f(self.tcx, self.impl_def_id) } else { Ok(()) }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue