@@ -142,28 +142,28 @@ fn main() {
142142
143143 let mut script_bench = NamedTimer :: start ( "Scripts" ) ;
144144
145- print_summary ( open_ports_per_ip, & scripts_to_run, & opts) ;
145+ print_summary ( & open_ports_per_ip, & scripts_to_run, & opts) ;
146146 // We only print closed ports if the user requested it.
147147 if opts. closed {
148148 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) ;
150150 }
151151
152152 // To use the runtime benchmark, run the process as: RUST_LOG=info ./rustscan
153153 script_bench. end ( ) ;
154154 benchmarks. push ( script_bench) ;
155155 rustscan_bench. end ( ) ;
156156 benchmarks. push ( rustscan_bench) ;
157- debug ! ( "Benchmarks raw {:?}" , benchmarks ) ;
157+ debug ! ( "Benchmarks raw {benchmarks :?}" ) ;
158158 info ! ( "{}" , benchmarks. summary( ) ) ;
159159}
160160
161161fn 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 ] ,
164164 opts : & Opts ,
165165) {
166- for ( ip, ports) in & ports_per_ip {
166+ for ( ip, ports) in ports_per_ip {
167167 let vec_str_ports: Vec < String > = ports. iter ( ) . map ( ToString :: to_string) . collect ( ) ;
168168
169169 // nmap port style is 80,443. Comma separated with no spaces.
@@ -177,7 +177,7 @@ fn print_summary(
177177 detail ! ( "Starting Script(s)" , opts. greppable, opts. accessible) ;
178178
179179 // 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 ( ) {
181181 // This part allows us to add commandline arguments to the Script call_format, appending them to the end of the command.
182182 if !opts. command . is_empty ( ) {
183183 let user_extra_args = & opts. command . join ( " " ) ;
@@ -216,14 +216,6 @@ fn print_summary(
216216 }
217217 }
218218 }
219-
220- // To use the runtime benchmark, run the process as: RUST_LOG=info ./rustscan
221- script_bench. end ( ) ;
222- benchmarks. push ( script_bench) ;
223- rustscan_bench. end ( ) ;
224- benchmarks. push ( rustscan_bench) ;
225- debug ! ( "Benchmarks raw {benchmarks:?}" ) ;
226- info ! ( "{}" , benchmarks. summary( ) ) ;
227219}
228220
229221/// Prints the opening title of RustScan
0 commit comments