diff --git a/Cargo.toml b/Cargo.toml index 2c01384..687c1db 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "wasm-timer" edition = "2018" description = "Abstraction over std::time::Instant and futures-timer that works on WASM" -version = "0.2.0" +version = "0.2.1" authors = ["Pierre Krieger "] license = "MIT" repository = "https://github.com/tomaka/wasm-timer" diff --git a/src/timer.rs b/src/timer.rs index 7d9e45a..8bf567a 100644 --- a/src/timer.rs +++ b/src/timer.rs @@ -531,7 +531,7 @@ impl TimerHandle { } unsafe fn from_usize(val: usize) -> TimerHandle { - let inner = mem::transmute::>(val);; + let inner = mem::transmute::>(val); TimerHandle { inner } } } diff --git a/src/timer/ext.rs b/src/timer/ext.rs index 0f1120a..1b14950 100644 --- a/src/timer/ext.rs +++ b/src/timer/ext.rs @@ -167,18 +167,17 @@ where unsafe_pinned!(stream: S); } -impl TryStream for TimeoutStream +impl Stream for TimeoutStream where S: TryStream, S::Error: From, { - type Ok = S::Ok; - type Error = S::Error; + type Item = Result; - fn try_poll_next( + fn poll_next( mut self: Pin<&mut Self>, cx: &mut Context<'_>, - ) -> Poll>> { + ) -> Poll> { let dur = self.dur; let r = self.as_mut().stream().try_poll_next(cx);