Skip to content

Commit

Permalink
refactor: fix nonexisting feature
Browse files Browse the repository at this point in the history
The `wasm32` is not a feature. It was probably supposed to be the target architecture.
  • Loading branch information
b-zee authored and joshuef committed Jun 17, 2024
1 parent e06121a commit 5da8ca2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sn_peers_acquisition/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,15 @@ pub fn parse_peer_addr(addr: &str) -> Result<Multiaddr> {
// Parse valid IPv4 socket address, e.g. `1.2.3.4:1234`.
if let Ok(addr) = addr.parse::<std::net::SocketAddrV4>() {
let start_addr = Multiaddr::from(*addr.ip());
// Start with an address into a `/ip4/<ip>/udp/<port>/quic-v1` multiaddr.

// Turn the address into a `/ip4/<ip>/udp/<port>/quic-v1` multiaddr.
#[cfg(not(feature = "websockets"))]
let multiaddr = start_addr
.with(Protocol::Udp(addr.port()))
.with(Protocol::QuicV1);

#[cfg(all(feature = "websockets", feature = "wasm32"))]
// Turn the address into a `/ip4/<ip>/udp/<port>/websocket-websys-v1` multiaddr.
#[cfg(feature = "websockets")]
let multiaddr = start_addr
.with(Protocol::Tcp(addr.port()))
.with(Protocol::Ws("/".into()));
Expand Down

0 comments on commit 5da8ca2

Please sign in to comment.