39-y-alias-for-no-confirm #45

Merged
Mr_Steppy merged 2 commits from 39-y-alias-for-no-confirm into master 2026-08-26 15:23:14 +02:00
Showing only changes of commit b107231e46 - Show all commits

View File

@ -7,27 +7,27 @@ use std::iter::once;
use std::process::{Command, ExitStatus, Output}; use std::process::{Command, ExitStatus, Output};
pub trait LogRunnable { pub trait LogRunnable {
fn run(&mut self, logger: &Logger) -> Result<(), CommandSpecificError<ExecutionError>>; fn run(&mut self, logger: &Logger) -> Result<(), CommandSpecificError<'_, ExecutionError>>;
fn collect_output(&mut self) -> Result<Output, CommandSpecificError<ExecutionError>>; fn collect_output(&mut self) -> Result<Output, CommandSpecificError<'_, ExecutionError>>;
fn collect_full_output(&mut self) -> Result<Output, CommandSpecificError<StartError>>; fn collect_full_output(&mut self) -> Result<Output, CommandSpecificError<'_, StartError>>;
} }
impl LogRunnable for Command { impl LogRunnable for Command {
fn run(&mut self, logger: &Logger) -> Result<(), CommandSpecificError<ExecutionError>> { fn run(&mut self, logger: &Logger) -> Result<(), CommandSpecificError<'_, ExecutionError>> {
run(self, logger).map_err(|error| CommandSpecificError { run(self, logger).map_err(|error| CommandSpecificError {
command: self, command: self,
error, error,
}) })
} }
fn collect_output(&mut self) -> Result<Output, CommandSpecificError<ExecutionError>> { fn collect_output(&mut self) -> Result<Output, CommandSpecificError<'_, ExecutionError>> {
collect_output(self, None).map_err(|error| CommandSpecificError { collect_output(self, None).map_err(|error| CommandSpecificError {
command: self, command: self,
error, error,
}) })
} }
fn collect_full_output(&mut self) -> Result<Output, CommandSpecificError<StartError>> { fn collect_full_output(&mut self) -> Result<Output, CommandSpecificError<'_, StartError>> {
collect_full_output(self).map_err(|error| CommandSpecificError { collect_full_output(self).map_err(|error| CommandSpecificError {
command: self, command: self,
error, error,