Hexadecimal Debug format of Id
This commit is contained in:
parent
e55b59256e
commit
c999ed038a
1 changed files with 7 additions and 1 deletions
|
@ -27,7 +27,7 @@ use std::hash::Hash;
|
||||||
///
|
///
|
||||||
/// Then there are widgets that need no identifiers at all, like labels,
|
/// Then there are widgets that need no identifiers at all, like labels,
|
||||||
/// because they have no state nor are interacted with.
|
/// because they have no state nor are interacted with.
|
||||||
#[derive(Clone, Copy, Debug, Hash, Eq, PartialEq)]
|
#[derive(Clone, Copy, Hash, Eq, PartialEq)]
|
||||||
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
|
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
|
||||||
pub struct Id(u64);
|
pub struct Id(u64);
|
||||||
|
|
||||||
|
@ -59,3 +59,9 @@ impl Id {
|
||||||
format!("{:04X}", self.0 as u16)
|
format!("{:04X}", self.0 as u16)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl std::fmt::Debug for Id {
|
||||||
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
|
write!(f, "{:X}", self.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue