From 1a9c5e0060b0986da5628503e0d7c5eb5275f357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Mon, 15 Nov 2021 13:51:25 +0100 Subject: [PATCH] pkstrings: rename strtohex to chrtohex MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- pkstrings/src/pkstring.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkstrings/src/pkstring.rs b/pkstrings/src/pkstring.rs index 1b308c9..252a3b4 100644 --- a/pkstrings/src/pkstring.rs +++ b/pkstrings/src/pkstring.rs @@ -36,7 +36,7 @@ const fn in_range(ord: u8) -> bool { } } -const fn strtohex(chr: &char) -> Option { +const fn chrtohex(chr: &char) -> Option { 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)), }