diff options
Diffstat (limited to 'cli/flags_allow_net.rs')
-rw-r--r-- | cli/flags_allow_net.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cli/flags_allow_net.rs b/cli/flags_allow_net.rs index d94766684..613ce04fe 100644 --- a/cli/flags_allow_net.rs +++ b/cli/flags_allow_net.rs @@ -26,7 +26,7 @@ impl FromStr for BarePort { } } -pub fn validator(host_and_port: String) -> Result<(), String> { +pub fn validator(host_and_port: &str) -> Result<(), String> { if Url::parse(&format!("deno://{}", host_and_port)).is_ok() || host_and_port.parse::<IpAddr>().is_ok() || host_and_port.parse::<BarePort>().is_ok() @@ -53,9 +53,9 @@ pub fn parse(paths: Vec<String>) -> clap::Result<Vec<String>> { out.push(format!("{}:{}", host, port.0)); } } else { - return Err(clap::Error::with_description( - &format!("Bad host:port pair: {}", host_and_port), + return Err(clap::Error::raw( clap::ErrorKind::InvalidValue, + format!("Bad host:port pair: {}", host_and_port), )); } } |