summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/connector.rs5
-rw-r--r--src/client/executor.rs7
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,
})
}