From 2e23d40733f8766bdb318a3ae39ece62a9f3bdfc Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sun, 14 Sep 2025 12:51:24 +0800 Subject: fix(connector): proper seperation of task args --- src/client/connector.rs | 5 ++--- src/client/executor.rs | 7 +++++-- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src/client') 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 { + pub(crate) fn new( + task: impl IntoTask, + args: impl IntoIterator, + ) -> Result { let task = task.into_task()?; Ok(Self { task: task, - args: Box::new([args]), + args: args.into_iter().collect(), output: None, }) } -- cgit v1.2.3