From 605663550000111a8df54a9e56e61bec4ce7f50c Mon Sep 17 00:00:00 2001 From: Karan Gauswami Date: Wed, 24 Nov 2021 23:02:25 +0530 Subject: [PATCH] removed allocations --- src/main.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index b1a62b3..3f925e0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -48,8 +48,7 @@ fn host_addr(uri: &http::Uri) -> Option { async fn proxy(req: Request, socks_address: SocketAddr) -> Result> { let mut connector = HttpConnector::new(); connector.enforce_http(false); - let proxy_addr = socks_address.to_string(); - let proxy_addr = Box::leak(Box::new(format!("socks://{}", proxy_addr.to_string()))); + let proxy_addr = Box::leak(Box::new(format!("socks://{}", socks_address))); let proxy_addr = Uri::from_static(proxy_addr); if let Some(plain) = host_addr(req.uri()) { if req.method() == hyper::Method::CONNECT {