From bee82bdefb67f84a0ca61d049ce7ea3be4bfcda9 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Fri, 22 Apr 2022 16:47:34 +0200 Subject: [PATCH] Use IntoIterator for custom xtask args So you wouldn't need to call `.into_iter()` first if you pass an array or something. --- nih_plug_xtask/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nih_plug_xtask/src/lib.rs b/nih_plug_xtask/src/lib.rs index d3b8dde2..321b5a27 100644 --- a/nih_plug_xtask/src/lib.rs +++ b/nih_plug_xtask/src/lib.rs @@ -58,9 +58,10 @@ pub fn main() -> Result<()> { /// The main xtask entry point function, but with custom command line arguments. `args` should not /// contain the command name, so you should always skip at least one argument from /// `std::env::args()` before passing it to this function. -pub fn main_with_args(command_name: &str, mut args: impl Iterator) -> Result<()> { +pub fn main_with_args(command_name: &str, args: impl IntoIterator) -> Result<()> { chdir_workspace_root()?; + let mut args = args.into_iter(); let usage_string = build_usage_string(command_name); let command = args .next()