summaryrefslogtreecommitdiff
path: root/src/executor.rs
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-09-21 22:59:47 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-09-21 22:59:47 +0800
commit2e1d12ec90ea12e8824d79dfc31b5b3cae397df8 (patch)
treefe052f73fcfa7d5bc195d74859a88a721bfd2520 /src/executor.rs
parent1a9961c778308fe2b043c980ba485a633e62d6cf (diff)
wip
Diffstat (limited to 'src/executor.rs')
-rw-r--r--src/executor.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/executor.rs b/src/executor.rs
index ec95b18..58be87d 100644
--- a/src/executor.rs
+++ b/src/executor.rs
@@ -1,15 +1,15 @@
-use crate::tasks::{CompletedTask, IntoTaskErr, Task, TaskOutput};
+use crate::tasks::{CompletedTask, Task, TaskOutput};
-pub struct Executor<'a, 't, N: Copy, T = ()> {
+pub struct Executor<'a, 't, N: Copy + PartialEq, T = ()> {
task: &'t Task<N, T>,
args: Box<[&'a str]>,
ctx: T,
complete_task: Option<CompletedTask<N>>,
}
-impl<'a, 't, N: Copy, T> Executor<'a, 't, N, T> {
- pub fn new(task: &'t Task<N, T>, args: impl IntoIterator<Item = &'a str>, ctx: T) -> Result<Self, IntoTaskErr> {
- Ok(Self { task: task, args: args.into_iter().collect(), ctx, complete_task: None })
+impl<'a, 't, N: Copy + PartialEq, T> Executor<'a, 't, N, T> {
+ pub fn new(task: &'t Task<N, T>, args: impl IntoIterator<Item = &'a str>, ctx: T) -> Self {
+ Self { task: task, args: args.into_iter().collect(), ctx, complete_task: None }
}
pub fn run(&mut self) -> &TaskOutput {