diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-09-14 12:51:24 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-09-14 12:51:24 +0800 |
| commit | 2e23d40733f8766bdb318a3ae39ece62a9f3bdfc (patch) | |
| tree | 39f9df70b63535d8edd17101ab79870607a091d0 /src/client | |
| parent | 29c1c417ded2f1e06dbe6b6c67288b1bcbe27d60 (diff) | |
fix(connector): proper seperation of task args
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/connector.rs | 5 | ||||
| -rw-r--r-- | src/client/executor.rs | 7 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/client/connector.rs b/src/client/connector.rs index e403317..6b59f60 100644 --- a/src/client/connector.rs +++ b/src/client/connector.rs @@ -38,16 +38,15 @@ pub(crate) trait Connection { Some(t) => t, None => continue, }; - let args: String = it.collect(); // FIXME: handle the errors... peak prod code self.ntfy( - Executor::new(task, args) + Executor::new(task, it.map(str::to_string)) .unwrap() .run() .unwrap() .clone() .unwrap(), - ); + ); //.unwrap() } Result::Err(e) => { #[cfg(debug_assertions)] diff --git a/src/client/executor.rs b/src/client/executor.rs index 5fbba0b..6a017f8 100644 --- a/src/client/executor.rs +++ b/src/client/executor.rs @@ -9,11 +9,14 @@ pub(crate) struct Executor<'a> { } impl<'a> Executor<'a> { - pub(crate) fn new(task: impl IntoTask, args: String) -> Result<Self, IntoTaskErr> { + pub(crate) fn new( + task: impl IntoTask, + args: impl IntoIterator<Item = String>, + ) -> Result<Self, IntoTaskErr> { let task = task.into_task()?; Ok(Self { task: task, - args: Box::new([args]), + args: args.into_iter().collect(), output: None, }) } |
