diff --git a/crates/client-api/src/util.rs b/crates/client-api/src/util.rs index 1aa0bc7fbd..26ddb7588d 100644 --- a/crates/client-api/src/util.rs +++ b/crates/client-api/src/util.rs @@ -1,6 +1,7 @@ mod flat_csv; pub mod websocket; +use core::fmt; use std::net::IpAddr; use axum::body::{Bytes, HttpBody}; @@ -106,3 +107,12 @@ impl<'de> serde::Deserialize<'de> for NameOrAddress { }) } } + +impl fmt::Display for NameOrAddress { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::Address(addr) => f.write_str(&addr.to_hex()), + Self::Name(name) => f.write_str(name), + } + } +}