Skip to content

Commit 22ba873

Browse files
rustyFishrock123
rusty
authored andcommitted
Expose reference of inner anyhow error with AsRef
1 parent 95002f7 commit 22ba873

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/error.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,3 +238,9 @@ impl From<Error> for Box<dyn StdError + 'static> {
238238
Box::<dyn StdError + Send + Sync>::from(error.error)
239239
}
240240
}
241+
242+
impl AsRef<anyhow::Error> for Error {
243+
fn as_ref(&self) -> &anyhow::Error {
244+
&self.error
245+
}
246+
}

0 commit comments

Comments
 (0)