Skip to content

Commit

Permalink
better
Browse files Browse the repository at this point in the history
  • Loading branch information
scarmuega committed Dec 23, 2023
1 parent 5b331a8 commit c420e42
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pallas-network/src/facades.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::path::Path;
use thiserror::Error;
use tracing::error;

use tokio::net::TcpListener;
use tokio::net::{TcpListener, ToSocketAddrs};

#[cfg(unix)]
use tokio::net::{unix::SocketAddr as UnixSocketAddr, UnixListener};
Expand Down Expand Up @@ -66,7 +66,7 @@ impl PeerClient {
}
}

pub async fn connect(addr: &str, magic: u64) -> Result<Self, Error> {
pub async fn connect(addr: impl ToSocketAddrs, magic: u64) -> Result<Self, Error> {
let bearer = Bearer::connect_tcp(addr)
.await
.map_err(Error::ConnectFailure)?;
Expand Down Expand Up @@ -232,7 +232,7 @@ impl NodeClient {
}

#[cfg(unix)]
pub async fn connect(path: &Path, magic: u64) -> Result<Self, Error> {
pub async fn connect(path: impl AsRef<Path>, magic: u64) -> Result<Self, Error> {
let bearer = Bearer::connect_unix(path)
.await
.map_err(Error::ConnectFailure)?;
Expand Down

0 comments on commit c420e42

Please sign in to comment.