From ebfef3f114c459f3767ab594f4bc0870388ccd8b Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Fri, 18 Oct 2024 09:58:41 +1100 Subject: [PATCH] Return generic error as Some The `std::error::Error` impl for `consensus::DecodeError` should return the inner generic error. --- bitcoin/src/consensus/error.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bitcoin/src/consensus/error.rs b/bitcoin/src/consensus/error.rs index 181b8d310..e1e0e2d1a 100644 --- a/bitcoin/src/consensus/error.rs +++ b/bitcoin/src/consensus/error.rs @@ -38,14 +38,14 @@ impl fmt::Display for DecodeError { } #[cfg(feature = "std")] -impl std::error::Error for DecodeError { +impl std::error::Error for DecodeError { fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { use DecodeError::*; match *self { TooManyBytes => None, Consensus(ref e) => Some(e), - Other(_) => None, // TODO: Is this correct? + Other(ref e) => Some(e), } } }