mirror of
https://github.com/bevyengine/bevy
synced 2024-11-27 23:20:20 +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 {
|
||||
type Item = PathBuf;
|
||||
|
||||
fn poll_next(
|
||||
self: Pin<&mut Self>,
|
||||
_cx: &mut core::task::Context<'_>,
|
||||
) -> Poll<Option<Self::Item>> {
|
||||
fn poll_next(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
|
||||
Poll::Ready(None)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<T: 'static> Task<T> {
|
|||
|
||||
impl<T> Future for Task<T> {
|
||||
type Output = T;
|
||||
fn poll(
|
||||
mut self: core::pin::Pin<&mut Self>,
|
||||
cx: &mut core::task::Context<'_>,
|
||||
) -> std::task::Poll<Self::Output> {
|
||||
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
|
||||
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<F: UnwindSafe>(#[pin] F);
|
|||
|
||||
impl<F: Future + UnwindSafe> Future for CatchUnwind<F> {
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue