]>
code.octet-stream.net Git - netwatcher/blob - src/util.rs
bbc4e6c5fb8c2a2247a2b1398331b2275b7a1a2a
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
)?
;