diff options
Diffstat (limited to 'src/executor.rs')
| -rw-r--r-- | src/executor.rs | 10 |
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 { |
