From a3b597ba7efbf7e0ddbe9d72e7202ea7a6b286a9 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Tue, 16 Sep 2025 21:13:35 +0800 Subject: perf: use explicit 'a lifetime instead of 'static --- src/client/executor.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/client/executor.rs') 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>, } -impl Executor { - pub fn new(task: &'static Task, args: impl IntoIterator) -> Result { +impl<'a> Executor<'a> { + pub fn new(task: &'a Task<'a>, args: impl IntoIterator) -> Result { Ok(Self { task: task, args: args.into_iter().collect(), output: None }) } -- cgit v1.2.3