Browse Source

Switch Cron to Box<[u8]>

master
Adrian Heine 2 years ago
parent
commit
93dba46387
  1. 2
      src/builder.rs
  2. 4
      src/symbols/cron.rs

2
src/builder.rs

@ -781,7 +781,7 @@ impl<D: Clone> ImplementationBuilder<Cron<D>> for DefaultBuilder {
UserForDomain(resource.0.clone())
}
type Implementation = CronSymbol<'static, Box<str>, Rc<str>, StdCommandRunner>;
type Implementation = CronSymbol<'static, Box<[u8]>, Rc<str>, StdCommandRunner>;
fn create(
resource: &Cron<D>,
(): &<Cron<D> as Resource>::Artifact,

4
src/symbols/cron.rs

@ -10,11 +10,11 @@ pub struct Cron<'r, C, U, R> {
command_runner: &'r R,
}
impl<'r, U, R> Cron<'r, Box<str>, U, R> {
impl<'r, U, R> Cron<'r, Box<[u8]>, U, R> {
pub fn new<C: AsRef<str>>(user: U, content: C, command_runner: &'r R) -> Self {
Self {
user,
content: (String::from(content.as_ref()) + "\n").into(),
content: (String::from(content.as_ref()) + "\n").as_bytes().into(),
command_runner,
}
}

Loading…
Cancel
Save