From 93dba4638708a903a4fbe3b5739676ea12602071 Mon Sep 17 00:00:00 2001 From: Adrian Heine Date: Sun, 18 Jun 2023 12:18:34 +0200 Subject: [PATCH] Switch Cron to Box<[u8]> --- src/builder.rs | 2 +- src/symbols/cron.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index 3230844..abfc965 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -781,7 +781,7 @@ impl ImplementationBuilder> for DefaultBuilder { UserForDomain(resource.0.clone()) } - type Implementation = CronSymbol<'static, Box, Rc, StdCommandRunner>; + type Implementation = CronSymbol<'static, Box<[u8]>, Rc, StdCommandRunner>; fn create( resource: &Cron, (): & as Resource>::Artifact, diff --git a/src/symbols/cron.rs b/src/symbols/cron.rs index c0d7008..1152a30 100644 --- a/src/symbols/cron.rs +++ b/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, U, R> { +impl<'r, U, R> Cron<'r, Box<[u8]>, U, R> { pub fn new>(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, } }