diff options
author | Leo Kettmeir <crowlkats@toaxl.com> | 2022-01-14 17:38:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-14 17:38:17 +0100 |
commit | e650165e80294fc66d88b0ff5451b5617bb8bff9 (patch) | |
tree | 3891947fb56ae1bbd05642a3e5d5e181a8284d5f /cli/flags_allow_net.rs | |
parent | 659bbd731cedbabe426c76e33cefcc68ee7d1e63 (diff) |
chore: upgrade clap to v3 (#13266)
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), )); } } |