mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-07 00:00:09 +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
|
||||
// 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::Poll::{Ready, Pending};
|
||||
|
||||
const BRANCHES: u32 = $crate::count!( $($count)* );
|
||||
|
||||
@@ -704,9 +702,9 @@ doc! {macro_rules! select {
|
||||
let mut fut = unsafe { Pin::new_unchecked(fut) };
|
||||
|
||||
// Try polling it
|
||||
let out = match Future::poll(fut, cx) {
|
||||
Ready(out) => out,
|
||||
Pending => {
|
||||
let out = match $crate::macros::support::Future::poll(fut, cx) {
|
||||
$crate::macros::support::Poll::Ready(out) => out,
|
||||
$crate::macros::support::Poll::Pending => {
|
||||
// Track that at least one future is
|
||||
// still pending and continue polling.
|
||||
is_pending = true;
|
||||
@@ -727,7 +725,7 @@ doc! {macro_rules! select {
|
||||
}
|
||||
|
||||
// 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"),
|
||||
@@ -735,10 +733,10 @@ doc! {macro_rules! select {
|
||||
}
|
||||
|
||||
if is_pending {
|
||||
Pending
|
||||
$crate::macros::support::Poll::Pending
|
||||
} else {
|
||||
// All branches have been disabled.
|
||||
Ready(__tokio_select_util::Out::Disabled)
|
||||
$crate::macros::support::Poll::Ready(__tokio_select_util::Out::Disabled)
|
||||
}
|
||||
}).await
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user