mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-07-25 19:52:50 +02:00
add debug impl for MAC type
Signed-off-by: Erik Hollensbe <git@hollensbe.org>
This commit is contained in:
parent
a453b25606
commit
187b78b367
1 changed files with 7 additions and 0 deletions
|
@ -6,6 +6,7 @@
|
|||
* https://www.zerotier.com/
|
||||
*/
|
||||
|
||||
use std::fmt::Debug;
|
||||
use std::hash::{Hash, Hasher};
|
||||
use std::num::NonZeroU64;
|
||||
use std::str::FromStr;
|
||||
|
@ -17,6 +18,12 @@ use crate::util::buffer::Buffer;
|
|||
#[repr(transparent)]
|
||||
pub struct MAC(NonZeroU64);
|
||||
|
||||
impl Debug for MAC {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
f.write_str(&self.to_string())
|
||||
}
|
||||
}
|
||||
|
||||
impl MAC {
|
||||
#[inline(always)]
|
||||
pub fn from_u64(i: u64) -> Option<MAC> {
|
||||
|
|
Loading…
Add table
Reference in a new issue