From: Matt Corallo Date: Mon, 23 Jan 2023 23:33:19 +0000 (+0000) Subject: `impl Display for NodeId` X-Git-Tag: v0.0.114-beta~36^2~2 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=869b71dccf1b6d22895067d461a408ac37012a26;p=rust-lightning `impl Display for NodeId` `NodeId` is a public key, there's not much reason to not implement `Display` for it and only `Debug`. --- diff --git a/lightning/src/routing/gossip.rs b/lightning/src/routing/gossip.rs index 1a5b97850..19bde3891 100644 --- a/lightning/src/routing/gossip.rs +++ b/lightning/src/routing/gossip.rs @@ -84,6 +84,11 @@ impl fmt::Debug for NodeId { write!(f, "NodeId({})", log_bytes!(self.0)) } } +impl fmt::Display for NodeId { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "{}", log_bytes!(self.0)) + } +} impl core::hash::Hash for NodeId { fn hash(&self, hasher: &mut H) {