chore: fix chores (#4060)

This commit is contained in:
Alice Ryhl
2021-08-24 14:57:23 +02:00
committed by GitHub
parent 84f6845bf2
commit 7e474640dd
3 changed files with 12 additions and 9 deletions
+1
View File
@@ -16,6 +16,7 @@
attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables))
))]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(docsrs, allow(unused_attributes))]
//! A runtime for writing reliable network applications without compromising speed.
//!
+1 -1
View File
@@ -176,7 +176,7 @@ macro_rules! cfg_net_unix {
($($item:item)*) => {
$(
#[cfg(all(unix, feature = "net"))]
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
#[cfg_attr(docsrs, doc(cfg(all(unix, feature = "net"))))]
$item
)*
}
+10 -8
View File
@@ -15,7 +15,7 @@ use std::{
use nix::unistd::{close, read, write};
use futures::{poll, FutureExt};
use futures::poll;
use tokio::io::unix::{AsyncFd, AsyncFdReadyGuard};
use tokio_test::{assert_err, assert_pending};
@@ -163,10 +163,11 @@ async fn initially_writable() {
afd_a.writable().await.unwrap().clear_ready();
afd_b.writable().await.unwrap().clear_ready();
futures::select_biased! {
_ = tokio::time::sleep(Duration::from_millis(10)).fuse() => {},
_ = afd_a.readable().fuse() => panic!("Unexpected readable state"),
_ = afd_b.readable().fuse() => panic!("Unexpected readable state"),
tokio::select! {
biased;
_ = tokio::time::sleep(Duration::from_millis(10)) => {},
_ = afd_a.readable() => panic!("Unexpected readable state"),
_ = afd_b.readable() => panic!("Unexpected readable state"),
}
}
@@ -353,12 +354,13 @@ async fn multiple_waiters() {
futures::future::pending::<()>().await;
};
futures::select_biased! {
guard = afd_a.readable().fuse() => {
tokio::select! {
biased;
guard = afd_a.readable() => {
tokio::task::yield_now().await;
guard.unwrap().clear_ready()
},
_ = notify_barrier.fuse() => unreachable!(),
_ = notify_barrier => unreachable!(),
}
std::mem::drop(afd_a);