diff options
| author | 魏曹先生 <1992414357@qq.com> | 2025-09-14 12:42:15 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2025-09-14 12:42:15 +0800 |
| commit | b8844ab55a6d622370be8ce41387ff9d9897302e (patch) | |
| tree | 049d6093491dba003994661dd51eba7db36c6219 /crates/utils/tcp_connection/src/target.rs | |
| parent | 5b26558c895e58a31a0ab7630b1c05c525091f53 (diff) | |
Fixed by Clippy
Diffstat (limited to 'crates/utils/tcp_connection/src/target.rs')
| -rw-r--r-- | crates/utils/tcp_connection/src/target.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/utils/tcp_connection/src/target.rs b/crates/utils/tcp_connection/src/target.rs index ec7b6af..8fc14ef 100644 --- a/crates/utils/tcp_connection/src/target.rs +++ b/crates/utils/tcp_connection/src/target.rs @@ -51,13 +51,13 @@ where Client: ClientHandle<Server>, } } -impl<Client, Server> Into<SocketAddr> for TcpServerTarget<Client, Server> +impl<Client, Server> From<TcpServerTarget<Client, Server>> for SocketAddr where Client: ClientHandle<Server>, Server: ServerHandle<Client> { /// Convert TcpServerTarget to SocketAddr - fn into(self) -> SocketAddr { - SocketAddr::new(self.bind_addr, self.port) + fn from(val: TcpServerTarget<Client, Server>) -> Self { + SocketAddr::new(val.bind_addr, val.port) } } @@ -123,7 +123,7 @@ async fn domain_to_addr<'a>(domain: impl Into<&'a str>) -> Result<SocketAddr, st let (host, port_str) = if let Some((host, port)) = domain.rsplit_once(':') { (host.trim_matches(|c| c == '[' || c == ']'), Some(port)) } else { - (&domain[..], None) + (domain, None) }; let port = port_str |
