From 275dee60e71225a9c6c4b3b4ea7ffe4c6ecb4d87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 23 Mar 2023 23:27:58 +0100 Subject: refactor: make version and user_agent &'static str (#18400) These caused a bunch of unnecessary allocations on each startup. --- ext/fetch/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ext/fetch/lib.rs') diff --git a/ext/fetch/lib.rs b/ext/fetch/lib.rs index 9ed73161d..17f30d8ed 100644 --- a/ext/fetch/lib.rs +++ b/ext/fetch/lib.rs @@ -114,7 +114,7 @@ deno_core::extension!(deno_fetch, state.put::(options.options.clone()); state.put::({ create_http_client( - options.options.user_agent, + &options.options.user_agent, options.options.root_cert_store, vec![], options.options.proxy, @@ -631,7 +631,7 @@ where .collect::>(); let client = create_http_client( - options.user_agent.clone(), + &options.user_agent, options.root_cert_store.clone(), ca_certs, args.proxy, @@ -646,7 +646,7 @@ where /// Create new instance of async reqwest::Client. This client supports /// proxies and doesn't follow redirects. pub fn create_http_client( - user_agent: String, + user_agent: &str, root_cert_store: Option, ca_certs: Vec>, proxy: Option, -- cgit v1.2.3