From 29b77d6a617183899580c2cf1e9cca67a623dfac Mon Sep 17 00:00:00 2001 From: Fabian Bees Date: Thu, 23 Jan 2025 09:23:04 +0100 Subject: [PATCH] fix clippy warnings --- src/main.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index 26a95fe47..6c52d3d35 100644 --- a/src/main.rs +++ b/src/main.rs @@ -142,11 +142,11 @@ fn main() { let mut script_bench = NamedTimer::start("Scripts"); - print_summary(open_ports_per_ip, &scripts_to_run, &opts); + print_summary(&open_ports_per_ip, &scripts_to_run, &opts); // We only print closed ports if the user requested it. if opts.closed { println!("closed ports:"); - print_summary(closed_ports_per_ip, &scripts_to_run, &opts); + print_summary(&closed_ports_per_ip, &scripts_to_run, &opts); } // To use the runtime benchmark, run the process as: RUST_LOG=info ./rustscan @@ -159,11 +159,11 @@ fn main() { } fn print_summary( - ports_per_ip: HashMap>, - scripts_to_run: &Vec, + ports_per_ip: &HashMap>, + scripts_to_run: &[ScriptFile], opts: &Opts, ) { - for (ip, ports) in &ports_per_ip { + for (ip, ports) in ports_per_ip { let vec_str_ports: Vec = ports.iter().map(ToString::to_string).collect(); // nmap port style is 80,443. Comma separated with no spaces. @@ -177,7 +177,7 @@ fn print_summary( detail!("Starting Script(s)", opts.greppable, opts.accessible); // Run all the scripts we found and parsed based on the script config file tags field. - for mut script_f in scripts_to_run.clone() { + for mut script_f in scripts_to_run.iter().cloned() { // This part allows us to add commandline arguments to the Script call_format, appending them to the end of the command. if !opts.command.is_empty() { let user_extra_args = &opts.command.join(" ");