`impl Display for NodeId`
authorMatt Corallo <git@bluematt.me>
Mon, 23 Jan 2023 23:33:19 +0000 (23:33 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 23 Jan 2023 23:39:40 +0000 (23:39 +0000)
`NodeId` is a public key, there's not much reason to not implement
`Display` for it and only `Debug`.

lightning/src/routing/gossip.rs

index 1a5b978502c0922c651d6fd3175c67f7ff1897fd..19bde38912aed23ab04b9fbe85690955936e8f20 100644 (file)
@@ -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<H: core::hash::Hasher>(&self, hasher: &mut H) {