]>
code.octet-stream.net Git - netwatcher/blob - src/util.rs
4 pub(crate) fn format_mac(bytes
: &[u8]) -> Result
<String
, Error
> {
5 let mut mac
= String
::with_capacity(bytes
.len() * 3);
6 for i
in 0..bytes
.len() {
8 write
!(mac
, ":").map_err(|_
| Error
::Internal
)?
;
10 write
!(mac
, "{:02X}", bytes
[i
]).map_err(|_
| Error
::Internal
)?
;