Switch Cron to Box<[u8]>

This commit is contained in:
Adrian Heine 2023-06-18 12:18:34 +02:00
parent d091265d27
commit 93dba46387
2 changed files with 3 additions and 3 deletions

View file

@ -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,
}
}