From 3cf2be51bc192942a7f94a123e6bb93797d657a7 Mon Sep 17 00:00:00 2001 From: Filip Tibell Date: Wed, 5 Jun 2024 18:52:38 +0200 Subject: [PATCH] Make with_args more permissive --- crates/lune/src/rt/runtime.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/lune/src/rt/runtime.rs b/crates/lune/src/rt/runtime.rs index 53a5970..08a601c 100644 --- a/crates/lune/src/rt/runtime.rs +++ b/crates/lune/src/rt/runtime.rs @@ -120,11 +120,13 @@ impl Runtime { Sets arguments to give in `process.args` for Lune scripts. */ #[must_use] - pub fn with_args(self, args: V) -> Self + pub fn with_args(self, args: A) -> Self where - V: Into>, + A: IntoIterator, + S: Into, { - self.inner.lua().set_app_data(args.into()); + let args = args.into_iter().map(Into::into).collect::>(); + self.inner.lua().set_app_data(args); self }