aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index ae346a1..36790b7 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -13,6 +13,17 @@ pub enum HexDecodeError {
13 InvalidHexCharacter, 13 InvalidHexCharacter,
14} 14}
15 15
16impl std::fmt::Display for HexDecodeError {
17 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
18 match self {
19 HexDecodeError::InvalidByteCount => write!(f, "Invalid byte count"),
20 HexDecodeError::InvalidHexCharacter => write!(f, "Invalid hex character"),
21 }
22 }
23}
24
25impl std::error::Error for HexDecodeError {}
26
16struct EncodeHexIterSlice<'data_lifetime> { 27struct EncodeHexIterSlice<'data_lifetime> {
17 //bytes to encode as hex 28 //bytes to encode as hex
18 data: &'data_lifetime [u8], 29 data: &'data_lifetime [u8],