From 53b53a27fd2c472893f974ace7c236cce53709e7 Mon Sep 17 00:00:00 2001 From: Erica Marigold <hi@devcomp.xyz> Date: Thu, 4 Jan 2024 18:33:51 +0530 Subject: [PATCH] fix: avoid collecting to unneeded VecDequeue --- src/executor.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/executor.rs b/src/executor.rs index 51d7787..183bc31 100644 --- a/src/executor.rs +++ b/src/executor.rs @@ -1,10 +1,4 @@ -use std::{ - collections::VecDeque, - env, - ops::ControlFlow, - process::{self, ExitCode}, - sync::Mutex, -}; +use std::{env, ops::ControlFlow, process::ExitCode, sync::Mutex}; use lune::Lune; @@ -94,8 +88,8 @@ pub async fn run_standalone(signature: Vec<u8>, bin: Vec<u8>) -> Result<ExitCode // If we were able to retrieve the required metadata, we load // and execute the bytecode - let mut args = env::args().collect::<VecDeque<String>>(); - args.pop_front(); + // Skip the first argument which is the path to current executable + let args = env::args().skip(1).collect::<Vec<_>>(); let result = Lune::new() .with_args(args)