perf: simplify method signatures and reduce clone across multiple files (#1663)

This commit is contained in:
Tunglies
2025-12-09 16:47:57 +08:00
committed by GitHub
parent 2bc51daa98
commit fe4dff5df0
33 changed files with 62 additions and 81 deletions
+3 -3
View File
@@ -73,7 +73,7 @@ impl WSTunnelListener {
}
}
async fn try_accept(&mut self, stream: TcpStream) -> Result<Box<dyn Tunnel>, TunnelError> {
async fn try_accept(&self, stream: TcpStream) -> Result<Box<dyn Tunnel>, TunnelError> {
let info = TunnelInfo {
tunnel_type: self.addr.scheme().to_owned(),
local_addr: Some(self.local_url().into()),
@@ -223,7 +223,7 @@ impl WSTunnelConnector {
}
async fn connect_with_default_bind(
&mut self,
&self,
addr: SocketAddr,
) -> Result<Box<dyn Tunnel>, super::TunnelError> {
let socket = if addr.is_ipv4() {
@@ -235,7 +235,7 @@ impl WSTunnelConnector {
}
async fn connect_with_custom_bind(
&mut self,
&self,
addr: SocketAddr,
) -> Result<Box<dyn Tunnel>, super::TunnelError> {
let futures = FuturesUnordered::new();