diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-09-16 21:13:35 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-09-17 21:28:52 +0800 |
| commit | a3b597ba7efbf7e0ddbe9d72e7202ea7a6b286a9 (patch) | |
| tree | ef2ab58378c6f5009f9aa4d8560dd34bb6861f9b /src/client/executor.rs | |
| parent | 368aee800658e9c1a9a30871c45fc6034cceda48 (diff) | |
perf: use explicit 'a lifetime instead of 'static
Diffstat (limited to 'src/client/executor.rs')
| -rw-r--r-- | src/client/executor.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/executor.rs b/src/client/executor.rs index 379c832..35e3f75 100644 --- a/src/client/executor.rs +++ b/src/client/executor.rs @@ -1,13 +1,13 @@ use remote_control_rs::tasks::{IntoTaskErr, Task}; -pub struct Executor { - task: &'static Task, +pub struct Executor<'a> { + task: &'a Task<'a>, args: Box<[String]>, output: Option<Result<String, String>>, } -impl Executor { - pub fn new(task: &'static Task, args: impl IntoIterator<Item = String>) -> Result<Self, IntoTaskErr> { +impl<'a> Executor<'a> { + pub fn new(task: &'a Task<'a>, args: impl IntoIterator<Item = String>) -> Result<Self, IntoTaskErr> { Ok(Self { task: task, args: args.into_iter().collect(), output: None }) } |
