mirror of https://github.com/zkat/miette.git
feat(error): impl AsRef<dyn StdError> for Report
This seems like an easy implementation to fill out, and will be used for tests in the following commit.
This commit is contained in:
parent
3fc5c04cbb
commit
1a27033d7a
|
|
@ -791,6 +791,18 @@ impl AsRef<dyn Diagnostic> for Report {
|
|||
}
|
||||
}
|
||||
|
||||
impl AsRef<dyn StdError + Send + Sync> for Report {
|
||||
fn as_ref(&self) -> &(dyn StdError + Send + Sync + 'static) {
|
||||
unsafe { ErrorImpl::error(self.inner.by_ref()) }
|
||||
}
|
||||
}
|
||||
|
||||
impl AsRef<dyn StdError> for Report {
|
||||
fn as_ref(&self) -> &(dyn StdError + 'static) {
|
||||
unsafe { ErrorImpl::error(self.inner.by_ref()) }
|
||||
}
|
||||
}
|
||||
|
||||
impl std::borrow::Borrow<dyn Diagnostic> for Report {
|
||||
fn borrow(&self) -> &(dyn Diagnostic + 'static) {
|
||||
self.as_ref()
|
||||
|
|
|
|||
Loading…
Reference in New Issue