From cbb5742ac356984deef1a6a9c850210fd95e5cf0 Mon Sep 17 00:00:00 2001 From: Adrian Heine Date: Sun, 24 Feb 2019 12:41:00 +0100 Subject: [PATCH] Don't require static lifetime in serve_php --- src/symbols/factory.rs | 3 ++- src/symbols/nginx/server.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/symbols/factory.rs b/src/symbols/factory.rs index ffb2e7d..b125391 100644 --- a/src/symbols/factory.rs +++ b/src/symbols/factory.rs @@ -1,3 +1,4 @@ +use std::borrow::Cow; use std::ops::Deref; use std::path::Path; @@ -103,7 +104,7 @@ pm.max_children = 10" )).into_action(self.symbol_runner) } - pub fn serve_php<'a>(&'a self, host_name: &'static str, root_dir: &'static str) -> Box { + pub fn serve_php<'a>(&'a self, host_name: &'static str, root_dir: Cow<'a, str>) -> Box { let user_name = self.policy.user_name_for_host(host_name); let socket = self.get_php_fpm_pool_socket_path(&user_name); Box::new(ListAction::new(vec![ diff --git a/src/symbols/nginx/server.rs b/src/symbols/nginx/server.rs index a44782c..ed2407a 100644 --- a/src/symbols/nginx/server.rs +++ b/src/symbols/nginx/server.rs @@ -100,7 +100,7 @@ location @proxy {{ NginxServer::new(domain, content, command_runner) } - pub fn new_php(domain: &'a str, socket_path: Cow<'a, str>, static_path: &'a str, command_runner: &'a C) -> Self { + pub fn new_php(domain: &'a str, socket_path: Cow<'a, str>, static_path: Cow<'a, str>, command_runner: &'a C) -> Self { let content = server_config(domain, &format!(" root {}; index index.html index.php;