Skip to content

Commit

Permalink
In #945fcd09 we forgot to update the impl fmt::Display trait and std:…
Browse files Browse the repository at this point in the history
…:error::Error for ParsePublicKeyError
  • Loading branch information
rockcoolsaint committed Jan 6, 2025
1 parent 70a8792 commit 39e3eb1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 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(err) => write!(f, "hex error {} at position {}", err.invalid_char() as char, err.pos()),
InvalidHexLength(got) =>
write!(f, "pubkey string should be 66 or 130 digits long, got: {}", got),
}
Expand All @@ -1050,7 +1050,8 @@ impl std::error::Error for ParsePublicKeyError {

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

0 comments on commit 39e3eb1

Please sign in to comment.