Skip to content

Commit

Permalink
In #945fcd09 we forgot to Update impl for ParsePublicKeyError Display…
Browse files Browse the repository at this point in the history
… and Error traits
  • Loading branch information
rockcoolsaint committed Jan 8, 2025
1 parent 70a8792 commit 7e7773f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bitcoin/src/crypto/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@ impl fmt::Display for ParsePublicKeyError {
use ParsePublicKeyError::*;
match self {
Encoding(e) => write_err!(f, "string error"; e),
InvalidChar(char) => write!(f, "hex error {}", char),
InvalidChar(e) => write_err!(f, "hex decoding"; e),
InvalidHexLength(got) =>
write!(f, "pubkey string should be 66 or 130 digits long, got: {}", got),
}
Expand All @@ -1048,9 +1048,10 @@ impl std::error::Error for ParsePublicKeyError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
use ParsePublicKeyError::*;

match self {
Encoding(e) => Some(e),
InvalidChar(_) | InvalidHexLength(_) => None,
match *self {
Encoding(ref e) => Some(e),
InvalidChar(ref e) => Some(e),
InvalidHexLength(_) => None,
}
}
}
Expand Down

0 comments on commit 7e7773f

Please sign in to comment.