From 88c4aee2ce3ccbae0681210e62f481705bdbf015 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 24 Jul 2021 19:02:25 +0100 Subject: [PATCH] config: fix client/server-specific parsing Signed-off-by: Ian Jackson --- src/config.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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(), } } -- 2.30.2