From: Ian Jackson Date: Sat, 24 Jul 2021 18:02:25 +0000 (+0100) Subject: config: fix client/server-specific parsing X-Git-Tag: hippotat/1.0.0~464 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=88c4aee2ce3ccbae0681210e62f481705bdbf015;p=hippotat.git config: fix client/server-specific parsing Signed-off-by: Ian Jackson --- diff --git a/src/config.rs b/src/config.rs index 83b1b1c..18e4969 100644 --- a/src/config.rs +++ b/src/config.rs @@ -565,18 +565,18 @@ impl<'c> ResolveContext<'c> { #[throws(AE)] pub fn client(&self, key: &'static str) -> T - where T: Parseable { + where T: Parseable + Default { match self.end { LinkEnd::Client => self.ordinary(key)?, - LinkEnd::Server => Parseable::default_for_key(key)?, + LinkEnd::Server => default(), } } #[throws(AE)] pub fn server(&self, key: &'static str) -> T - where T: Parseable { + where T: Parseable + Default { match self.end { LinkEnd::Server => self.ordinary(key)?, - LinkEnd::Client => Parseable::default_for_key(key)?, + LinkEnd::Client => default(), } }