From 0df7338ebc4ae010ea27d9155e890a8495c12f96 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 25 Jul 2021 18:44:03 +0100 Subject: [PATCH] Change InstanceConfig to have a LinkName Signed-off-by: Ian Jackson --- src/config.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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() } } -- 2.30.2