From 2e85a6e31d1acb82d6af690446dbd42303a6b1bc Mon Sep 17 00:00:00 2001 From: ggFROOK <93028567+NewBieCoderXD@users.noreply.github.com> Date: Fri, 11 Jul 2025 13:54:25 +0700 Subject: [PATCH] change from HashMap to Vec (#792) --- src/input.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/input.rs b/src/input.rs index 2536e8b..2660531 100644 --- a/src/input.rs +++ b/src/input.rs @@ -1,7 +1,6 @@ //! Provides a means to read, parse and hold configuration options for scans. use clap::{Parser, ValueEnum}; use serde_derive::Deserialize; -use std::collections::HashMap; use std::fs; use std::path::PathBuf; @@ -218,11 +217,7 @@ impl Opts { // Only use top ports when the user asks for them if self.top && config.ports.is_some() { - let mut ports: Vec = Vec::with_capacity(config.ports.as_ref().unwrap().len()); - for entry in config.ports.as_ref().unwrap().keys() { - ports.push(entry.parse().unwrap()); - } - self.ports = Some(ports); + self.ports = config.ports.clone(); } merge_optional!(range, resolver, ulimit, exclude_ports, exclude_addresses); @@ -263,7 +258,7 @@ impl Default for Opts { #[derive(Debug, Deserialize)] pub struct Config { addresses: Option>, - ports: Option>, + ports: Option>, range: Option, greppable: Option, accessible: Option,