diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-09-19 22:59:22 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-09-20 23:34:15 +0800 |
| commit | c7a2788158628d3445f0f3574a0d7adfabd0a755 (patch) | |
| tree | 0c0e973b70f07cd4797b60bd17ca6d4b8e0f348d /src/client/executor.rs | |
| parent | 6511f6aaf68c3ab3bce10cdd743936b28e45dfa9 (diff) | |
init
Diffstat (limited to 'src/client/executor.rs')
| -rw-r--r-- | src/client/executor.rs | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/src/client/executor.rs b/src/client/executor.rs deleted file mode 100644 index 26ac0ba..0000000 --- a/src/client/executor.rs +++ /dev/null @@ -1,18 +0,0 @@ -use remote_control_rs::tasks::{IntoTaskErr, Task}; - -pub struct Executor<'a, 't> { - task: &'t Task, - args: Box<[&'a str]>, - output: Option<Result<String, String>>, -} - -impl<'a, 't> Executor<'a, 't> { - pub fn new(task: &'t Task, args: impl IntoIterator<Item = &'a str>) -> Result<Self, IntoTaskErr> { - Ok(Self { task: task, args: args.into_iter().collect(), output: None }) - } - - pub fn run(&mut self) -> Option<&Result<String, String>> { - self.output = Some((self.task.exec)(&self.args)); - self.output.as_ref() - } -} |
