No need for FnMut when FnOnce works now
This commit is contained in:
parent
23277a502e
commit
7f871ab9aa
1 changed files with 2 additions and 2 deletions
|
@ -53,9 +53,9 @@ struct Checker<'tcx> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'tcx> Checker<'tcx> {
|
impl<'tcx> Checker<'tcx> {
|
||||||
fn check<F>(&self, trait_def_id: Option<DefId>, mut f: F) -> Result<(), ErrorGuaranteed>
|
fn check<F>(&self, trait_def_id: Option<DefId>, f: F) -> Result<(), ErrorGuaranteed>
|
||||||
where
|
where
|
||||||
F: FnMut(TyCtxt<'tcx>, LocalDefId) -> Result<(), ErrorGuaranteed>,
|
F: FnOnce(TyCtxt<'tcx>, LocalDefId) -> Result<(), ErrorGuaranteed>,
|
||||||
{
|
{
|
||||||
if Some(self.trait_def_id) == trait_def_id { f(self.tcx, self.impl_def_id) } else { Ok(()) }
|
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