From 76e952830302271e07a4be9df6dfaa1c11e3e675 Mon Sep 17 00:00:00 2001 From: hozan23 Date: Wed, 13 Mar 2024 03:35:09 +0100 Subject: net: pass `Endpoint` to dial and listen functions --- net/src/connection.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'net/src/connection.rs') diff --git a/net/src/connection.rs b/net/src/connection.rs index 73606a2..ea73a39 100644 --- a/net/src/connection.rs +++ b/net/src/connection.rs @@ -57,8 +57,8 @@ pub trait Connection: Send + Sync { /// pub async fn dial(endpoint: &Endpoint) -> Result { match endpoint { - Endpoint::Tcp(addr, port) => Ok(Box::new(tcp::dial_tcp(addr, port).await?)), - Endpoint::Udp(addr, port) => Ok(Box::new(udp::dial_udp(addr, port).await?)), + Endpoint::Tcp(_, _) => Ok(Box::new(tcp::dial_tcp(endpoint).await?)), + Endpoint::Udp(_, _) => Ok(Box::new(udp::dial_udp(endpoint).await?)), Endpoint::Unix(addr) => Ok(Box::new(unix::dial_unix(addr).await?)), _ => Err(Error::InvalidEndpoint(endpoint.to_string())), } -- cgit v1.2.3