From: Ian Jackson Date: Sun, 25 Jul 2021 17:44:03 +0000 (+0100) Subject: Change InstanceConfig to have a LinkName X-Git-Tag: hippotat/1.0.0~447 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=0df7338ebc4ae010ea27d9155e890a8495c12f96;p=hippotat.git Change InstanceConfig to have a LinkName Signed-off-by: Ian Jackson --- diff --git a/src/config.rs b/src/config.rs index 69718d7..76cafdb 100644 --- a/src/config.rs +++ b/src/config.rs @@ -10,7 +10,7 @@ use configparser::ini::Ini; #[derive(Debug,Clone)] pub struct InstanceConfig { // Exceptional settings - #[special(special_server, SKL::ServerName)] pub server: ServerName, + #[special(special_link, SKL::ServerName)] pub link: LinkName, pub secret: Secret, #[special(special_ipif, SKL::Ordinary)] pub ipif: String, @@ -193,9 +193,7 @@ impl FromStr for SectionName { } impl Display for InstanceConfig { #[throws(fmt::Error)] - fn fmt(&self, f: &mut fmt::Formatter) { - write!(f, "[{} {}]", &self.server, &self.vaddr)?; - } + fn fmt(&self, f: &mut fmt::Formatter) { Display::fmt(&self.link, f)? } } impl Display for SectionName { @@ -637,8 +635,8 @@ impl<'c> ResolveContext<'c> { } #[throws(AE)] - pub fn special_server(&self, _key: &'static str) -> ServerName { - self.link.server.clone() + pub fn special_link(&self, _key: &'static str) -> LinkName { + self.link.clone() } }