mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-08 00:00:13 +02:00
macros: remove (most) local use declarations in tokio::select! (#7929)
This commit is contained in:
@@ -615,9 +615,7 @@ doc! {macro_rules! select {
|
|||||||
|
|
||||||
// `tokio::macros::support` is a public, but doc(hidden) module
|
// `tokio::macros::support` is a public, but doc(hidden) module
|
||||||
// including a re-export of all types needed by this macro.
|
// including a re-export of all types needed by this macro.
|
||||||
use $crate::macros::support::Future;
|
|
||||||
use $crate::macros::support::Pin;
|
use $crate::macros::support::Pin;
|
||||||
use $crate::macros::support::Poll::{Ready, Pending};
|
|
||||||
|
|
||||||
const BRANCHES: u32 = $crate::count!( $($count)* );
|
const BRANCHES: u32 = $crate::count!( $($count)* );
|
||||||
|
|
||||||
@@ -704,9 +702,9 @@ doc! {macro_rules! select {
|
|||||||
let mut fut = unsafe { Pin::new_unchecked(fut) };
|
let mut fut = unsafe { Pin::new_unchecked(fut) };
|
||||||
|
|
||||||
// Try polling it
|
// Try polling it
|
||||||
let out = match Future::poll(fut, cx) {
|
let out = match $crate::macros::support::Future::poll(fut, cx) {
|
||||||
Ready(out) => out,
|
$crate::macros::support::Poll::Ready(out) => out,
|
||||||
Pending => {
|
$crate::macros::support::Poll::Pending => {
|
||||||
// Track that at least one future is
|
// Track that at least one future is
|
||||||
// still pending and continue polling.
|
// still pending and continue polling.
|
||||||
is_pending = true;
|
is_pending = true;
|
||||||
@@ -727,7 +725,7 @@ doc! {macro_rules! select {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// The select is complete, return the value
|
// The select is complete, return the value
|
||||||
return Ready($crate::select_variant!(__tokio_select_util::Out, ($($skip)*))(out));
|
return $crate::macros::support::Poll::Ready($crate::select_variant!(__tokio_select_util::Out, ($($skip)*))(out));
|
||||||
}
|
}
|
||||||
)*
|
)*
|
||||||
_ => unreachable!("reaching this means there probably is an off by one bug"),
|
_ => unreachable!("reaching this means there probably is an off by one bug"),
|
||||||
@@ -735,10 +733,10 @@ doc! {macro_rules! select {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if is_pending {
|
if is_pending {
|
||||||
Pending
|
$crate::macros::support::Poll::Pending
|
||||||
} else {
|
} else {
|
||||||
// All branches have been disabled.
|
// All branches have been disabled.
|
||||||
Ready(__tokio_select_util::Out::Disabled)
|
$crate::macros::support::Poll::Ready(__tokio_select_util::Out::Disabled)
|
||||||
}
|
}
|
||||||
}).await
|
}).await
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user