mirror of
https://github.com/lune-org/lune.git
synced 2024-12-12 13:00:37 +00:00
Make with_args more permissive
This commit is contained in:
parent
a3f0f279a8
commit
3cf2be51bc
1 changed files with 5 additions and 3 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue