Expose reference of inner anyhow error with AsRef

This commit is contained in:
rusty 2021-06-22 13:12:05 +09:00 committed by Jacob Rothstein
parent c22ef5df3c
commit 382bdf32a0
1 changed files with 6 additions and 0 deletions

View File

@ -238,3 +238,9 @@ impl From<Error> for Box<dyn StdError + 'static> {
Box::<dyn StdError + Send + Sync>::from(error.error)
}
}
impl AsRef<anyhow::Error> for Error {
fn as_ref(&self) -> &anyhow::Error {
&self.error
}
}