Skip to content

Commit 7d7af99

Browse files
first fixes
1 parent 26f6198 commit 7d7af99

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ blocking = { version = "0.5.2", optional = true }
8686
futures-lite = { version = "0.1.8", optional = true }
8787

8888
[target.'cfg(target_arch = "wasm32")'.dependencies]
89-
futures-timer = { version = "3.0.2", optional = true, features = ["wasm-bindgen"] }
89+
futures-timer = { version = "3.0.2", features = ["wasm-bindgen"] }
9090
wasm-bindgen-futures = { version = "0.4.10", optional = true }
9191
futures-channel = { version = "0.3.4", optional = true }
9292

src/task/join_handle.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,17 @@ impl<T> Drop for JoinHandle<T> {
7878
impl<T> Future for JoinHandle<T> {
7979
type Output = T;
8080

81+
#[cfg(not(target_os = "unknown"))]
8182
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
8283
Pin::new(&mut self.handle.as_mut().unwrap()).poll(cx)
8384
}
85+
86+
#[cfg(target_arch = "wasm32")]
87+
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
88+
match Pin::new(&mut self.handle.as_mut().unwrap()).poll(cx) {
89+
Poll::Ready(Ok(t)) => Poll::Ready(t),
90+
Poll::Ready(Err(_)) => unreachable!("channel must not be canceled"),
91+
Poll::Pending => Poll::Pending,
92+
}
93+
}
8494
}

0 commit comments

Comments
 (0)