Reject odd number of hexits rather than ignoring the lone trailing hexit

This commit is contained in:
Tony Garnock-Jones 2022-10-26 12:49:34 +02:00
parent fd121cfb4c
commit ad1aec3d89
1 changed files with 5 additions and 1 deletions

View File

@ -36,9 +36,13 @@ impl HexParser {
}, },
} }
} }
if buf_full {
None // odd number of hexits
} else {
Some(result) Some(result)
} }
} }
}
impl HexFormatter { impl HexFormatter {
pub fn encode(&self, bs: &[u8]) -> String { pub fn encode(&self, bs: &[u8]) -> String {