From ffd85372d33285c664ac17637389471879283c88 Mon Sep 17 00:00:00 2001 From: Adrian Heine Date: Wed, 11 Dec 2019 21:56:02 +0100 Subject: [PATCH] Extract get_cert --- src/symbols/factory.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/symbols/factory.rs b/src/symbols/factory.rs index 0f54f70..7dfea68 100644 --- a/src/symbols/factory.rs +++ b/src/symbols/factory.rs @@ -59,9 +59,13 @@ impl<'b, C: 'b + CommandRunner, P: 'b + Policy> SymbolFactory<'b, C, P> { } } - pub fn get_nginx_acme_server<'a, 'c: 'a, S: 'a + Symbol>( - &'c self, - host: &'static str, + pub fn get_cert<'a, H: 'a + AsRef + Clone>(&'a self, host: H) -> impl Symbol + 'a { + self.acme_factory.get_cert(host) + } + + pub fn get_nginx_acme_server<'a, S: 'a + Symbol>( + &'a self, + host: &'a str, nginx_server_symbol: S, ) -> impl Symbol + 'a { List::from(( @@ -71,7 +75,7 @@ impl<'b, C: 'b + CommandRunner, P: 'b + Policy> SymbolFactory<'b, C, P> { ReloadService::new("nginx", self.command_runner), ), Hook::new( - self.acme_factory.get_cert(host), + self.get_cert(host), ReloadService::new("nginx", self.command_runner), ), ))