@@ -142,11 +142,11 @@ fn main() {
142
142
143
143
let mut script_bench = NamedTimer :: start ( "Scripts" ) ;
144
144
145
- print_summary ( open_ports_per_ip, & scripts_to_run, & opts) ;
145
+ print_summary ( & open_ports_per_ip, & scripts_to_run, & opts) ;
146
146
// We only print closed ports if the user requested it.
147
147
if opts. closed {
148
148
println ! ( "closed ports:" ) ;
149
- print_summary ( closed_ports_per_ip, & scripts_to_run, & opts) ;
149
+ print_summary ( & closed_ports_per_ip, & scripts_to_run, & opts) ;
150
150
}
151
151
152
152
// To use the runtime benchmark, run the process as: RUST_LOG=info ./rustscan
@@ -159,11 +159,11 @@ fn main() {
159
159
}
160
160
161
161
fn print_summary (
162
- ports_per_ip : HashMap < IpAddr , Vec < u16 > > ,
163
- scripts_to_run : & Vec < ScriptFile > ,
162
+ ports_per_ip : & HashMap < IpAddr , Vec < u16 > > ,
163
+ scripts_to_run : & [ ScriptFile ] ,
164
164
opts : & Opts ,
165
165
) {
166
- for ( ip, ports) in & ports_per_ip {
166
+ for ( ip, ports) in ports_per_ip {
167
167
let vec_str_ports: Vec < String > = ports. iter ( ) . map ( ToString :: to_string) . collect ( ) ;
168
168
169
169
// nmap port style is 80,443. Comma separated with no spaces.
@@ -177,7 +177,7 @@ fn print_summary(
177
177
detail ! ( "Starting Script(s)" , opts. greppable, opts. accessible) ;
178
178
179
179
// Run all the scripts we found and parsed based on the script config file tags field.
180
- for mut script_f in scripts_to_run. clone ( ) {
180
+ for mut script_f in scripts_to_run. iter ( ) . cloned ( ) {
181
181
// This part allows us to add commandline arguments to the Script call_format, appending them to the end of the command.
182
182
if !opts. command . is_empty ( ) {
183
183
let user_extra_args = & opts. command . join ( " " ) ;
0 commit comments