From 0a6b6efd7afc9b7dc2d931a9b07b133d846dbf7a Mon Sep 17 00:00:00 2001 From: Adrian Heine Date: Tue, 2 Sep 2025 11:47:48 +0200 Subject: [PATCH] Streamline command runner a bit --- src/command_runner.rs | 4 ++-- src/symbols/cron.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/command_runner.rs b/src/command_runner.rs index a463f6a..3ef8934 100644 --- a/src/command_runner.rs +++ b/src/command_runner.rs @@ -29,7 +29,7 @@ pub fn is_success(res: Result) -> Result Result, Box> { +pub fn get_stdout(output: Output) -> Result, Box> { Ok(check_success(output)?.stdout) } @@ -55,7 +55,7 @@ pub trait CommandRunner { args: &'a [&'a OsStr], ) -> Result, Box> { let output = self.run_with_args(program, args).await?; - get_output(output) + get_stdout(output) } async fn run_successfully<'a>( &self, diff --git a/src/symbols/cron.rs b/src/symbols/cron.rs index 1152a30..86cfd9f 100644 --- a/src/symbols/cron.rs +++ b/src/symbols/cron.rs @@ -37,7 +37,7 @@ impl, U: AsRef, R: CommandRunner> Symbol for Cron<'_, C, U, .run( "crontab", args!["-u", self.user.as_ref(), "-",], - self.content.as_ref(), + self.content.as_ref(), // input ) .await, )?;