pkstrings: Don't consume PKString when converting to String
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
d2df9f1097
commit
99043c9dd2
1 changed files with 4 additions and 4 deletions
|
@ -202,13 +202,13 @@ impl From<PKString> for Vec<u8> {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<PKString> for String {
|
||||
fn from(pkstr: PKString) -> String {
|
||||
impl From<&PKString> for String {
|
||||
fn from(pkstr: &PKString) -> String {
|
||||
let placeholder = '_';
|
||||
let mut buf = String::new();
|
||||
|
||||
for ord in pkstr.0 {
|
||||
match hextochr(ord) {
|
||||
for ord in &pkstr.0 {
|
||||
match hextochr(*ord) {
|
||||
Some(chr) => buf.push(chr),
|
||||
None => buf.push(placeholder.clone()),
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue