X-Git-Url: https://code.octet-stream.net/netwatcher/blobdiff_plain/7cbddf0b21f7cf98b46c66a430eb8221f3622d55..d2c9a9f306a336aa9dd8ddfb6579746e4f10b7a4:/src/list_unix.rs diff --git a/src/list_unix.rs b/src/list_unix.rs index 45ffc63..fad4306 100644 --- a/src/list_unix.rs +++ b/src/list_unix.rs @@ -62,11 +62,11 @@ pub(crate) fn list_interfaces() -> Result { fn format_mac(bytes: &[u8]) -> Result { let mut mac = String::with_capacity(bytes.len() * 3); - for i in 0..bytes.len() { + for (i, b) in bytes.iter().enumerate() { if i != 0 { write!(mac, ":").map_err(|_| Error::Internal)?; } - write!(mac, "{:02X}", bytes[i]).map_err(|_| Error::Internal)?; + write!(mac, "{:02X}", b).map_err(|_| Error::Internal)?; } Ok(mac) }