Skip to content

Commit

Permalink
remove redundant arc
Browse files Browse the repository at this point in the history
  • Loading branch information
scarmuega committed Dec 21, 2023
1 parent 91c5e7d commit 4a95baf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
7 changes: 2 additions & 5 deletions pallas-network/src/facades.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,8 @@ impl NodeServer {
}
}

pub async fn accept(
listener: impl AsRef<UnixListener> + Send + 'static,
magic: u64,
) -> Result<Self, Error> {
let (bearer, address) = Bearer::accept_unix(listener.as_ref())
pub async fn accept(listener: &UnixListener, magic: u64) -> Result<Self, Error> {
let (bearer, address) = Bearer::accept_unix(listener)
.await
.map_err(Error::ConnectFailure)?;

Expand Down
5 changes: 2 additions & 3 deletions pallas-network/tests/protocols.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::fs;
use std::net::{Ipv4Addr, SocketAddrV4};
use std::sync::Arc;
use std::time::Duration;

use pallas_codec::utils::{AnyCbor, AnyUInt, KeyValuePairs, TagWrap};
Expand Down Expand Up @@ -468,9 +467,9 @@ pub async fn local_state_query_server_and_client_happy_path() {
fs::remove_file(socket_path).unwrap();
}

let listener = Arc::new(UnixListener::bind(socket_path).unwrap());
let listener = UnixListener::bind(socket_path).unwrap();

let mut server = pallas_network::facades::NodeServer::accept(listener, 0)
let mut server = pallas_network::facades::NodeServer::accept(&listener, 0)
.await
.unwrap();

Expand Down

0 comments on commit 4a95baf

Please sign in to comment.