Skip to content

Commit f804dbd

Browse files
fixup wasm imports
1 parent bf779eb commit f804dbd

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

iroh-relay/src/client.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ use std::{
1010
};
1111

1212
use conn::Conn;
13+
#[cfg(not(wasm_browser))]
1314
use connect_relay::DnsError;
1415
use iroh_base::{RelayUrl, SecretKey};
1516
use n0_future::{
1617
split::{split, SplitSink, SplitStream},
17-
Sink, Stream,
18+
time, Sink, Stream,
1819
};
1920
#[cfg(any(test, feature = "test-utils"))]
2021
use tracing::warn;
@@ -52,6 +53,7 @@ pub enum Error {
5253
InvalidWebsocketUrl(Url),
5354
#[error(transparent)]
5455
Websocket(#[from] tokio_tungstenite_wasm::Error),
56+
#[cfg(not(wasm_browser))]
5557
#[error(transparent)]
5658
Dns(#[from] DnsError),
5759
#[error(transparent)]
@@ -67,7 +69,7 @@ pub enum Error {
6769
#[error(transparent)]
6870
Io(#[from] std::io::Error),
6971
#[error("Timeout")]
70-
Timeout(#[from] tokio::time::error::Elapsed),
72+
Timeout(#[from] time::Elapsed),
7173
#[error(transparent)]
7274
Http(#[from] hyper::http::Error),
7375
#[error("Unexpected frame received {0}")]

iroh-relay/src/protos/relay.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use bytes::{BufMut, Bytes};
1616
use iroh_base::{PublicKey, SecretKey, Signature, SignatureError};
1717
#[cfg(feature = "server")]
1818
use n0_future::time::Duration;
19-
use n0_future::{Sink, SinkExt};
19+
use n0_future::{time, Sink, SinkExt};
2020
#[cfg(any(test, feature = "server"))]
2121
use n0_future::{Stream, StreamExt};
2222
use postcard::experimental::max_size::MaxSize;
@@ -137,7 +137,7 @@ pub enum Error {
137137
#[error(transparent)]
138138
SerDe(#[from] postcard::Error),
139139
#[error("timeout")]
140-
Timeout(#[from] tokio::time::error::Elapsed),
140+
Timeout(#[from] time::Elapsed),
141141
#[error(transparent)]
142142
InvalidSignature(#[from] SignatureError),
143143
#[error(transparent)]

0 commit comments

Comments
 (0)