Switch CommandRunner to OsStr

This commit is contained in:
Adrian Heine 2017-09-06 21:33:05 +02:00
parent b8bac1142c
commit 3b45b0f77c
22 changed files with 220 additions and 148 deletions

View file

@ -6,13 +6,13 @@ use std::path::Path;
use command_runner::CommandRunner;
use symbols::{Action, OwnedSymbolAction, Symbol, SymbolAction, SymbolRunner};
pub struct TlsKey<'a> {
pub struct TlsKey<'a, C: 'a + CommandRunner> {
domain: Cow<'a, str>,
command_runner: &'a CommandRunner
command_runner: &'a C
}
impl<'a> TlsKey<'a> {
pub fn new(domain: Cow<'a, str>, command_runner: &'a CommandRunner) -> TlsKey<'a> {
impl<'a, C: CommandRunner> TlsKey<'a, C> {
pub fn new(domain: Cow<'a, str>, command_runner: &'a C) -> Self {
TlsKey {
domain: domain,
command_runner: command_runner
@ -28,13 +28,13 @@ impl<'a> TlsKey<'a> {
}
}
impl<'a> fmt::Display for TlsKey<'a> {
impl<'a, C: CommandRunner> fmt::Display for TlsKey<'a, C> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "TlsKey {}", self.domain)
}
}
impl<'a> Symbol for TlsKey<'a> {
impl<'a, C: CommandRunner> Symbol for TlsKey<'a, C> {
fn target_reached(&self) -> Result<bool, Box<Error>> {
if !Path::new(&self.get_path()).exists() {
return Ok(false);