mirror of https://github.com/zkat/miette.git
fix(protocol): implement source/cause for Box<dyn Diagnostic>
This commit is contained in:
parent
9901030eb1
commit
3e8a27e263
|
|
@ -52,7 +52,15 @@ pub trait Diagnostic: std::error::Error {
|
|||
}
|
||||
}
|
||||
|
||||
impl std::error::Error for Box<dyn Diagnostic> {}
|
||||
impl std::error::Error for Box<dyn Diagnostic> {
|
||||
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
|
||||
(**self).source()
|
||||
}
|
||||
|
||||
fn cause(&self) -> Option<&dyn std::error::Error> {
|
||||
self.source()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Diagnostic + Send + Sync + 'static> From<T>
|
||||
for Box<dyn Diagnostic + Send + Sync + 'static>
|
||||
|
|
|
|||
Loading…
Reference in New Issue