pkstrings: rename strtohex to chrtohex
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
31290b2bbc
commit
1a9c5e0060
1 changed files with 2 additions and 2 deletions
|
@ -36,7 +36,7 @@ const fn in_range(ord: u8) -> bool {
|
|||
}
|
||||
}
|
||||
|
||||
const fn strtohex(chr: &char) -> Option<u8> {
|
||||
const fn chrtohex(chr: &char) -> Option<u8> {
|
||||
Some(match chr {
|
||||
cap @ 'A'..='Z' => 0x80 - ('A' as u8) + (*cap as u8),
|
||||
'(' => 0x9a,
|
||||
|
@ -182,7 +182,7 @@ impl TryFrom<&str> for PKString {
|
|||
let mut buf = Vec::with_capacity(data.len());
|
||||
|
||||
for chr in data.chars() {
|
||||
match strtohex(&chr) {
|
||||
match chrtohex(&chr) {
|
||||
Some(ord) => buf.push(ord),
|
||||
None => return Err(Error::InvalidCharacter(chr)),
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue