pkstrings: prefer String::from in example

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2021-11-14 15:46:42 +01:00
parent 5900325086
commit d54e39dcf6
Signed by: pep
GPG key ID: DEDA74AEECA9D0F2

View file

@ -41,7 +41,7 @@ fn read_data(data: Vec<u8>) {
for (offset, ord) in data.iter().enumerate() { for (offset, ord) in data.iter().enumerate() {
// Read current chr // Read current chr
if let Ok(pkstr) = PKString::try_from(*ord) { if let Ok(pkstr) = PKString::try_from(*ord) {
buffer.push(pkstr.into_string()); buffer.push(String::from(pkstr));
} else { } else {
if buffer.len() >= 4 { if buffer.len() >= 4 {
print_buffer(offset, &buffer); print_buffer(offset, &buffer);