diff --git a/crates/bevy_asset/src/io/mod.rs b/crates/bevy_asset/src/io/mod.rs index 735c7527ca..948382ca31 100644 --- a/crates/bevy_asset/src/io/mod.rs +++ b/crates/bevy_asset/src/io/mod.rs @@ -728,10 +728,7 @@ struct EmptyPathStream; impl Stream for EmptyPathStream { type Item = PathBuf; - fn poll_next( - self: Pin<&mut Self>, - _cx: &mut core::task::Context<'_>, - ) -> Poll> { + fn poll_next(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll> { Poll::Ready(None) } } diff --git a/crates/bevy_tasks/src/wasm_task.rs b/crates/bevy_tasks/src/wasm_task.rs index 572b381043..cdf805b2b8 100644 --- a/crates/bevy_tasks/src/wasm_task.rs +++ b/crates/bevy_tasks/src/wasm_task.rs @@ -3,7 +3,7 @@ use core::{ future::{Future, IntoFuture}, panic::{AssertUnwindSafe, UnwindSafe}, pin::Pin, - task::Poll, + task::{Context, Poll}, }; use futures_channel::oneshot; @@ -53,10 +53,7 @@ impl Task { impl Future for Task { type Output = T; - fn poll( - mut self: core::pin::Pin<&mut Self>, - cx: &mut core::task::Context<'_>, - ) -> std::task::Poll { + fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { match Pin::new(&mut self.0).poll(cx) { Poll::Ready(Ok(Ok(value))) => Poll::Ready(value), // NOTE: Propagating the panic here sorta has parity with the async_executor behavior. @@ -76,7 +73,7 @@ struct CatchUnwind(#[pin] F); impl Future for CatchUnwind { type Output = Result; - fn poll(self: core::pin::Pin<&mut Self>, cx: &mut core::task::Context) -> Poll { + fn poll(self: Pin<&mut Self>, cx: &mut Context) -> Poll { std::panic::catch_unwind(AssertUnwindSafe(|| self.project().0.poll(cx)))?.map(Ok) } }