From 35466de9f0ccabf88e1dfaa97fe39e5e74614f52 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sun, 14 Sep 2025 17:58:45 +0800 Subject: perf: static lifetime for task perf: non borrowed array for signal handling --- src/client/executor.rs | 6 +++--- src/client/main.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/client/executor.rs b/src/client/executor.rs index 6a017f8..7f11941 100644 --- a/src/client/executor.rs +++ b/src/client/executor.rs @@ -2,13 +2,13 @@ use crate::executor::tasks::{IntoTask, IntoTaskErr, Task}; pub(crate) mod tasks; -pub(crate) struct Executor<'a> { - task: &'a Task, +pub(crate) struct Executor { + task: &'static Task, args: Box<[String]>, output: Option>, } -impl<'a> Executor<'a> { +impl Executor { pub(crate) fn new( task: impl IntoTask, args: impl IntoIterator, diff --git a/src/client/main.rs b/src/client/main.rs index 3ef11cc..14c5636 100644 --- a/src/client/main.rs +++ b/src/client/main.rs @@ -8,7 +8,7 @@ mod connector; mod executor; fn main() { - _ = Signals::new(&[ + _ = Signals::new([ SIGHUP, SIGINT, SIGQUIT, -- cgit v1.2.3