Skip to content

Commit

Permalink
fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianbees committed Feb 4, 2025
1 parent b21dd2a commit 9b56a19
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -159,11 +159,11 @@ fn main() {
}

fn print_summary(
ports_per_ip: HashMap<IpAddr, Vec<u16>>,
scripts_to_run: &Vec<ScriptFile>,
ports_per_ip: &HashMap<IpAddr, Vec<u16>>,
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<String> = ports.iter().map(ToString::to_string).collect();

// nmap port style is 80,443. Comma separated with no spaces.
Expand All @@ -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(" ");
Expand Down

0 comments on commit 9b56a19

Please sign in to comment.