X-Git-Url: https://code.octet-stream.net/netwatcher/blobdiff_plain/7cbddf0b21f7cf98b46c66a430eb8221f3622d55..325d5d14560f2190818d6826366dfe88d3857302:/src/list_unix.rs?ds=sidebyside 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) }