Skip to content

Commit 7a2b64a

Browse files
committed
primitives - ChannelId - impl Display
1 parent 472537b commit 7a2b64a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

primitives/src/channel.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ impl FromHex for ChannelId {
4545
}
4646
}
4747

48+
impl fmt::Display for ChannelId {
49+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
50+
write!(f, "{}", format!("0x{}", hex::encode(self.0)))
51+
}
52+
}
53+
4854
#[derive(Serialize, Deserialize, Debug, Clone)]
4955
#[serde(rename_all = "camelCase")]
5056
pub struct Channel {

0 commit comments

Comments
 (0)