Skip to content

Commit bb1f22e

Browse files
authored
Merge pull request #96 from alexanderwiederin/display-warning
Feat(state): Add Display implementation for Warning enum
2 parents cf05085 + 03dd62e commit bb1f22e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/notifications/types.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,19 @@ impl From<btck_Warning> for Warning {
8686
}
8787
}
8888

89+
impl std::fmt::Display for Warning {
90+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
91+
match self {
92+
Warning::UnknownNewRulesActivated => {
93+
write!(f, "Unknown new rules activated")
94+
}
95+
Warning::LargeWorkInvalidChain => {
96+
write!(f, "Large work invalid chain")
97+
}
98+
}
99+
}
100+
}
101+
89102
/// Result of data structure validation.
90103
///
91104
/// Indicates whether a validated data structure (block, transaction, etc.)

0 commit comments

Comments
 (0)