aboutsummaryrefslogtreecommitdiff
path: root/net/src/connection.rs
diff options
context:
space:
mode:
authorhozan23 <hozan23@proton.me>2024-03-13 03:35:09 +0100
committerhozan23 <hozan23@proton.me>2024-03-13 03:35:09 +0100
commit76e952830302271e07a4be9df6dfaa1c11e3e675 (patch)
tree41202b50d07821caeee8fc2332bf9b5cc0f5f413 /net/src/connection.rs
parent5f403823fa3c2ef0c85dd81fe3601d084d0067e5 (diff)
net: pass `Endpoint` to dial and listen functions
Diffstat (limited to 'net/src/connection.rs')
-rw-r--r--net/src/connection.rs4
1 files changed, 2 insertions, 2 deletions
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<Conn> {
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())),
}