summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-09-14 17:58:45 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-09-14 17:58:45 +0800
commit35466de9f0ccabf88e1dfaa97fe39e5e74614f52 (patch)
treeb5a60cba2ebf891d45a22698e3602db244ec206f
parent2e23d40733f8766bdb318a3ae39ece62a9f3bdfc (diff)
perf: static lifetime for task
perf: non borrowed array for signal handling
-rw-r--r--src/client/executor.rs6
-rw-r--r--src/client/main.rs2
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<Result<String, String>>,
}
-impl<'a> Executor<'a> {
+impl Executor {
pub(crate) fn new(
task: impl IntoTask,
args: impl IntoIterator<Item = String>,
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,