Implement std::error::Error::source for bip152
During the recent merge of bip152 we ended up with a Rust 1.29 version of the `error::Error`. Implement `source` inline with our new MSRV.
This commit is contained in:
parent
a37ab82503
commit
613f1cf2d5
|
@ -38,7 +38,16 @@ impl fmt::Display for Error {
|
|||
}
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
impl error::Error for Error {}
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
|
||||
impl std::error::Error for Error {
|
||||
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
|
||||
use self::Error::*;
|
||||
|
||||
match *self {
|
||||
UnknownVersion | InvalidPrefill => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A [PrefilledTransaction] structure is used in [HeaderAndShortIds] to
|
||||
/// provide a list of a few transactions explicitly.
|
||||
|
|
Loading…
Reference in New Issue