summaryrefslogtreecommitdiff
path: root/cli/flags_allow_net.rs
diff options
context:
space:
mode:
authorLeo Kettmeir <crowlkats@toaxl.com>2022-01-14 17:38:17 +0100
committerGitHub <noreply@github.com>2022-01-14 17:38:17 +0100
commite650165e80294fc66d88b0ff5451b5617bb8bff9 (patch)
tree3891947fb56ae1bbd05642a3e5d5e181a8284d5f /cli/flags_allow_net.rs
parent659bbd731cedbabe426c76e33cefcc68ee7d1e63 (diff)
chore: upgrade clap to v3 (#13266)
Diffstat (limited to 'cli/flags_allow_net.rs')
-rw-r--r--cli/flags_allow_net.rs6
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),
));
}
}