1
Fork 0

Remove clone_code method

This commit is contained in:
Oli Scherer 2022-05-10 10:42:29 +00:00
parent dc21fcb2fc
commit 05a62c5527
3 changed files with 15 additions and 31 deletions

View file

@ -163,13 +163,6 @@ impl<'tcx> ObligationCause<'tcx> {
self.code.as_deref().unwrap_or(&MISC_OBLIGATION_CAUSE_CODE)
}
pub fn clone_code(&self) -> Lrc<ObligationCauseCode<'tcx>> {
match &self.code {
Some(code) => code.clone(),
None => Lrc::new(MISC_OBLIGATION_CAUSE_CODE),
}
}
pub fn map_code(
&mut self,
f: impl FnOnce(Lrc<ObligationCauseCode<'tcx>>) -> Lrc<ObligationCauseCode<'tcx>>,