From: Ian Jackson Date: Tue, 10 Jan 2023 01:50:30 +0000 (+0000) Subject: Implement Debug manually for LinkName X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=1760ad0d133286837e219dc8f78f64724e36b0b5;p=hippotat.git Implement Debug manually for LinkName Signed-off-by: Ian Jackson --- diff --git a/src/types.rs b/src/types.rs index 162b61e..cb2a154 100644 --- a/src/types.rs +++ b/src/types.rs @@ -13,12 +13,17 @@ pub struct ServerName(pub String); #[derive(Debug,Clone,Copy,Hash,Eq,PartialEq,Ord,PartialOrd)] pub struct ClientName(pub IpAddr); -#[derive(Debug,Clone,Hash,Eq,PartialEq,Ord,PartialOrd)] +#[derive(Clone,Hash,Eq,PartialEq,Ord,PartialOrd)] pub struct LinkName { pub server: ServerName, pub client: ClientName, } +impl Debug for LinkName { + #[throws(fmt::Error)] + fn fmt(&self, f: &mut fmt::Formatter) { write!(f, "LinkName({})", self)?; } +} + impl FromStr for ClientName { type Err = AE; #[throws(AE)]