Make with_args more permissive

This commit is contained in:
Filip Tibell 2024-06-05 18:52:38 +02:00
parent a3f0f279a8
commit 3cf2be51bc
No known key found for this signature in database

View file

@ -120,11 +120,13 @@ impl Runtime {
Sets arguments to give in `process.args` for Lune scripts.
*/
#[must_use]
pub fn with_args<V>(self, args: V) -> Self
pub fn with_args<A, S>(self, args: A) -> Self
where
V: Into<Vec<String>>,
A: IntoIterator<Item = S>,
S: Into<String>,
{
self.inner.lua().set_app_data(args.into());
let args = args.into_iter().map(Into::into).collect::<Vec<_>>();
self.inner.lua().set_app_data(args);
self
}