summaryrefslogtreecommitdiff
path: root/runtime/permissions/mod.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-06-05 20:35:39 -0400
committerGitHub <noreply@github.com>2023-06-06 00:35:39 +0000
commit5c55f2b4fb9f386d5589e4cbd4c513ecb1bae50b (patch)
treeaeffd55113b13518b28116f3048aaff572e4cae5 /runtime/permissions/mod.rs
parent8829a1d3620cab23f7ac724feeae60c9de6ebad2 (diff)
chore: upgrade to Rust 1.70.0 (#19345)
Co-authored-by: linbingquan <695601626@qq.com>
Diffstat (limited to 'runtime/permissions/mod.rs')
-rw-r--r--runtime/permissions/mod.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/permissions/mod.rs b/runtime/permissions/mod.rs
index f1d0362ca..e3ddd8cf4 100644
--- a/runtime/permissions/mod.rs
+++ b/runtime/permissions/mod.rs
@@ -18,6 +18,7 @@ use deno_core::ModuleSpecifier;
use deno_core::OpState;
use log;
use once_cell::sync::Lazy;
+use std::borrow::Cow;
use std::collections::HashSet;
use std::fmt;
use std::hash::Hash;
@@ -872,8 +873,8 @@ impl UnaryPermission<NetDescriptor> {
.ok_or_else(|| uri_error("Missing host"))?
.to_string();
let display_host = match url.port() {
- None => hostname.clone(),
- Some(port) => format!("{hostname}:{port}"),
+ None => Cow::Borrowed(&hostname),
+ Some(port) => Cow::Owned(format!("{hostname}:{port}")),
};
let host = &(&hostname, url.port_or_known_default());
let (result, prompted, is_allow_all) = self.query(Some(host)).check(