From 5c55f2b4fb9f386d5589e4cbd4c513ecb1bae50b Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 5 Jun 2023 20:35:39 -0400 Subject: chore: upgrade to Rust 1.70.0 (#19345) Co-authored-by: linbingquan <695601626@qq.com> --- runtime/permissions/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'runtime') 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 { .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( -- cgit v1.2.3