This commit is contained in:
Adrian Heine 2018-08-21 21:46:51 +02:00
parent 44ea23c1b5
commit 34f8dbffab
8 changed files with 78 additions and 50 deletions

View file

@ -43,7 +43,7 @@ impl<E: Error> fmt::Display for NginxServerError<E> {
pub struct NginxServer<'a, C: 'a + CommandRunner, T> where T: Deref<Target=str> {
command_runner: &'a C,
file: FileSymbol<T, Cow<'a, str>>,
file: FileSymbol<T, String>,
}
use std::borrow::Cow;
@ -121,7 +121,7 @@ location @proxy {{
}
pub fn new(domain: &'a str, content: String, command_runner: &'a C) -> Self {
let file_path: Cow<str> = Cow::from(String::from("/etc/nginx/sites-enabled/") + domain);
let file_path = String::from("/etc/nginx/sites-enabled/") + domain;
NginxServer {
command_runner: command_runner,
file: FileSymbol::new(file_path, content)