mirror of
https://github.com/bevyengine/bevy
synced 2024-11-24 05:33:04 +00:00
Resolve unused_qualifications warnings (#16001)
# Objective Fixes the following warning when compiling to wasm. ``` warning: unnecessary qualification --> crates\bevy_asset\src\io\mod.rs:733:19 | 733 | _cx: &mut core::task::Context<'_>, | ^^^^^^^^^^^^^^^^^^^^^^^ | = note: requested on the command line with `-W unused-qualifications` help: remove the unnecessary path segments | 733 - _cx: &mut core::task::Context<'_>, 733 + _cx: &mut Context<'_>, | ``` ## Solution - Removes the qualification.
This commit is contained in:
parent
61350cd36f
commit
f821768e62
2 changed files with 4 additions and 10 deletions
|
@ -728,10 +728,7 @@ struct EmptyPathStream;
|
||||||
impl Stream for EmptyPathStream {
|
impl Stream for EmptyPathStream {
|
||||||
type Item = PathBuf;
|
type Item = PathBuf;
|
||||||
|
|
||||||
fn poll_next(
|
fn poll_next(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
|
||||||
self: Pin<&mut Self>,
|
|
||||||
_cx: &mut core::task::Context<'_>,
|
|
||||||
) -> Poll<Option<Self::Item>> {
|
|
||||||
Poll::Ready(None)
|
Poll::Ready(None)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ use core::{
|
||||||
future::{Future, IntoFuture},
|
future::{Future, IntoFuture},
|
||||||
panic::{AssertUnwindSafe, UnwindSafe},
|
panic::{AssertUnwindSafe, UnwindSafe},
|
||||||
pin::Pin,
|
pin::Pin,
|
||||||
task::Poll,
|
task::{Context, Poll},
|
||||||
};
|
};
|
||||||
|
|
||||||
use futures_channel::oneshot;
|
use futures_channel::oneshot;
|
||||||
|
@ -53,10 +53,7 @@ impl<T: 'static> Task<T> {
|
||||||
|
|
||||||
impl<T> Future for Task<T> {
|
impl<T> Future for Task<T> {
|
||||||
type Output = T;
|
type Output = T;
|
||||||
fn poll(
|
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
|
||||||
mut self: core::pin::Pin<&mut Self>,
|
|
||||||
cx: &mut core::task::Context<'_>,
|
|
||||||
) -> std::task::Poll<Self::Output> {
|
|
||||||
match Pin::new(&mut self.0).poll(cx) {
|
match Pin::new(&mut self.0).poll(cx) {
|
||||||
Poll::Ready(Ok(Ok(value))) => Poll::Ready(value),
|
Poll::Ready(Ok(Ok(value))) => Poll::Ready(value),
|
||||||
// NOTE: Propagating the panic here sorta has parity with the async_executor behavior.
|
// NOTE: Propagating the panic here sorta has parity with the async_executor behavior.
|
||||||
|
@ -76,7 +73,7 @@ struct CatchUnwind<F: UnwindSafe>(#[pin] F);
|
||||||
|
|
||||||
impl<F: Future + UnwindSafe> Future for CatchUnwind<F> {
|
impl<F: Future + UnwindSafe> Future for CatchUnwind<F> {
|
||||||
type Output = Result<F::Output, Panic>;
|
type Output = Result<F::Output, Panic>;
|
||||||
fn poll(self: core::pin::Pin<&mut Self>, cx: &mut core::task::Context) -> Poll<Self::Output> {
|
fn poll(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Self::Output> {
|
||||||
std::panic::catch_unwind(AssertUnwindSafe(|| self.project().0.poll(cx)))?.map(Ok)
|
std::panic::catch_unwind(AssertUnwindSafe(|| self.project().0.poll(cx)))?.map(Ok)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue