From b7bc239c47d419ea5c5b078b89ca11def6c7311b Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Wed, 17 Sep 2025 19:24:00 +0800 Subject: perf: more prevalent &str --- src/client/connector/httpconnector.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/client/connector') diff --git a/src/client/connector/httpconnector.rs b/src/client/connector/httpconnector.rs index c6be503..9addf66 100644 --- a/src/client/connector/httpconnector.rs +++ b/src/client/connector/httpconnector.rs @@ -7,7 +7,7 @@ use reqwest::{ use std::{net::IpAddr, thread::sleep, time::Duration}; pub struct HTTPConnector { - network_enforcer: Executor<'static>, + network_enforcer: Executor<'static, 'static>, pull_url: Url, ntfy_url: Url, ip_getter_url: Url, @@ -18,7 +18,7 @@ pub struct HTTPConnector { impl HTTPConnector { pub fn new(pull_url: &str, ntfy_url: &str, ip_getter_url: &str) -> std::result::Result { Ok(Self { - network_enforcer: Executor::new(&NETWORK_T, ["on".to_string()]).unwrap(), // .unwrap() should never panic + network_enforcer: Executor::new(&NETWORK_T, ["on"]).unwrap(), // .unwrap() should never panic prev: String::new(), pull_url: Url::parse(pull_url)?, ntfy_url: Url::parse(ntfy_url)?, -- cgit v1.2.3