Inverse alternative formatting for LeafVersion type

This commit is contained in:
Dr Maxim Orlovsky 2022-01-09 20:50:22 +01:00
parent bec6694233
commit 6a3f3aabaf
1 changed files with 4 additions and 4 deletions

View File

@ -849,10 +849,10 @@ impl LeafVersion {
impl fmt::Display for LeafVersion {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match (self, f.alternate()) {
(LeafVersion::TapScript, false) => f.write_str("tapscript"),
(LeafVersion::TapScript, true) => fmt::Display::fmt(&TAPROOT_LEAF_TAPSCRIPT, f),
(LeafVersion::Future(version), false) => write!(f, "future_script_{:#02x}", version.0),
(LeafVersion::Future(version), true) => fmt::Display::fmt(version, f),
(LeafVersion::TapScript, true) => f.write_str("tapscript"),
(LeafVersion::TapScript, false) => fmt::Display::fmt(&TAPROOT_LEAF_TAPSCRIPT, f),
(LeafVersion::Future(version), true) => write!(f, "future_script_{:#02x}", version.0),
(LeafVersion::Future(version), false) => fmt::Display::fmt(version, f),
}
}
}