Browse Source

Use clone in newAcmeUser

master
Adrian Heine 5 years ago
parent
commit
8bcd03c7da
  1. 7
      src/symbols/acme/user.rs
  2. 4
      src/symbols/factory.rs

7
src/symbols/acme/user.rs

@ -8,7 +8,7 @@ use symbols::list::List;
use symbols::owner::Owner;
use symbols::Symbol;
pub fn new<'a, R: CommandRunner, C: 'a + AsRef<str>, U: 'a + AsRef<str>, H: AsRef<Path>>(
pub fn new<'a, R: CommandRunner, C: 'a + AsRef<str>, U: 'a + AsRef<str> + Clone, H: AsRef<Path>>(
command_runner: &'a R,
cert: C,
user_name: U,
@ -18,16 +18,15 @@ pub fn new<'a, R: CommandRunner, C: 'a + AsRef<str>, U: 'a + AsRef<str>, H: AsRe
let account_key_file = path("account.key");
List::from((
AcmeAccountKey::new(account_key_file.clone(), command_runner),
// FIXME into or cow or clone
Owner::new(
account_key_file,
user_name.as_ref().to_owned(),
user_name.clone(),
command_runner,
),
Dir::new(path("challenges")),
Owner::new(
path("challenges"),
user_name.as_ref().to_owned(),
user_name.clone(),
command_runner,
),
Dir::new("/etc/ssl/local_certs"),

4
src/symbols/factory.rs

@ -341,13 +341,13 @@ env[PATH] = /usr/local/bin:/usr/bin:/bin
Cron::new(user, content, self.command_runner)
}
pub fn get_acme_user<'a, S: 'a + AsRef<str>, D: 'a + AsRef<str>>(
pub fn get_acme_user<'a, S: 'a + AsRef<str> + Clone, D: 'a + AsRef<str>>(
&'a self,
cert: D,
user_name: S,
) -> impl Symbol + 'a {
let home = self.policy.home_for_user(user_name.as_ref());
newAcmeUser(self.command_runner, cert, user_name, home)
newAcmeUser(self.command_runner, cert, user_name.clone(), home)
}
pub fn get_systemd_user_service<'a>(

Loading…
Cancel
Save