summaryrefslogtreecommitdiff
path: root/wpa-psk/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'wpa-psk/src/lib.rs')
-rw-r--r--wpa-psk/src/lib.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/wpa-psk/src/lib.rs b/wpa-psk/src/lib.rs
index d0ffbc4..b16186f 100644
--- a/wpa-psk/src/lib.rs
+++ b/wpa-psk/src/lib.rs
@@ -155,7 +155,11 @@ pub fn wpa_psk_unchecked(ssid: &[u8], passphrase: &[u8]) -> [u8; 32] {
/// Returns the hexdecimal representation of the given bytes.
pub fn bytes_to_hex(bytes: &[u8]) -> String {
- bytes.iter().map(|b| format!("{b:02x}")).collect()
+ use std::fmt::Write;
+ bytes.iter().fold(String::new(), |mut acc, b| {
+ let _ = write!(acc, "{b:02x}");
+ acc
+ })
}
#[cfg(test)]
Generated by cgit. See skreutz.com for my tech blog and contact information.