diff options
author | Stefan Kreutz <mail@skreutz.com> | 2024-03-06 01:55:10 +0100 |
---|---|---|
committer | Stefan Kreutz <mail@skreutz.com> | 2024-03-06 01:55:10 +0100 |
commit | 91ef9a2298c2610f76061d43b94d549b7b642155 (patch) | |
tree | 8ae66efbcf8924b0fe75fe25d2b4fe3a94f1c34b /wpa-psk/src/lib.rs | |
parent | 678a974dd9db3b6b5a15e70d7d2fe2201f49aa30 (diff) | |
download | wpa-psk-91ef9a2298c2610f76061d43b94d549b7b642155.tar |
Fix clippy::format_collect lint
See
https://rust-lang.github.io/rust-clippy/stable/index.html#/format_collect
Diffstat (limited to 'wpa-psk/src/lib.rs')
-rw-r--r-- | wpa-psk/src/lib.rs | 6 |
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)] |