LowerHex and UpperHex implementations for LeafVersion

This commit is contained in:
Dr Maxim Orlovsky 2022-01-09 20:52:38 +01:00
parent 6a3f3aabaf
commit 7f06e91a93
1 changed files with 12 additions and 0 deletions

View File

@ -857,6 +857,18 @@ impl fmt::Display for LeafVersion {
} }
} }
impl fmt::LowerHex for LeafVersion {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt::LowerHex::fmt(&self.into_consensus(), f)
}
}
impl fmt::UpperHex for LeafVersion {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt::UpperHex::fmt(&self.into_consensus(), f)
}
}
#[cfg(feature = "serde")] #[cfg(feature = "serde")]
#[cfg_attr(docsrs, doc(cfg(feature = "serde")))] #[cfg_attr(docsrs, doc(cfg(feature = "serde")))]
impl ::serde::Serialize for LeafVersion { impl ::serde::Serialize for LeafVersion {