@@ -94,7 +94,7 @@ use core::pin::Pin;
94
94
use core:: ptr;
95
95
use core:: task:: { Context , Poll , Waker } ;
96
96
97
- #[ cfg( all( feature = "std" , not( target_family = "wasm" ) , ) ) ]
97
+ #[ cfg( all( feature = "std" , not( target_family = "wasm" ) ) ) ]
98
98
use {
99
99
parking:: { Parker , Unparker } ,
100
100
std:: time:: { Duration , Instant } ,
@@ -720,7 +720,7 @@ impl<T> EventListener<T> {
720
720
/// // Receive the notification.
721
721
/// listener.as_mut().wait();
722
722
/// ```
723
- #[ cfg( all( feature = "std" , not( target_family = "wasm" ) , ) ) ]
723
+ #[ cfg( all( feature = "std" , not( target_family = "wasm" ) ) ) ]
724
724
pub fn wait ( self : Pin < & mut Self > ) -> T {
725
725
self . listener ( ) . wait_internal ( None ) . unwrap ( )
726
726
}
@@ -741,7 +741,7 @@ impl<T> EventListener<T> {
741
741
/// // There are no notification so this times out.
742
742
/// assert!(listener.as_mut().wait_timeout(Duration::from_secs(1)).is_none());
743
743
/// ```
744
- #[ cfg( all( feature = "std" , not( target_family = "wasm" ) , ) ) ]
744
+ #[ cfg( all( feature = "std" , not( target_family = "wasm" ) ) ) ]
745
745
pub fn wait_timeout ( self : Pin < & mut Self > , timeout : Duration ) -> Option < T > {
746
746
self . listener ( )
747
747
. wait_internal ( Instant :: now ( ) . checked_add ( timeout) )
@@ -763,7 +763,7 @@ impl<T> EventListener<T> {
763
763
/// // There are no notification so this times out.
764
764
/// assert!(listener.as_mut().wait_deadline(Instant::now() + Duration::from_secs(1)).is_none());
765
765
/// ```
766
- #[ cfg( all( feature = "std" , not( target_family = "wasm" ) , ) ) ]
766
+ #[ cfg( all( feature = "std" , not( target_family = "wasm" ) ) ) ]
767
767
pub fn wait_deadline ( self : Pin < & mut Self > , deadline : Instant ) -> Option < T > {
768
768
self . listener ( ) . wait_internal ( Some ( deadline) )
769
769
}
@@ -882,7 +882,7 @@ impl<T, B: Borrow<Inner<T>> + Unpin> Listener<T, B> {
882
882
}
883
883
884
884
/// Wait until the provided deadline.
885
- #[ cfg( all( feature = "std" , not( target_family = "wasm" ) , ) ) ]
885
+ #[ cfg( all( feature = "std" , not( target_family = "wasm" ) ) ) ]
886
886
fn wait_internal ( mut self : Pin < & mut Self > , deadline : Option < Instant > ) -> Option < T > {
887
887
use std:: cell:: RefCell ;
888
888
@@ -916,7 +916,7 @@ impl<T, B: Borrow<Inner<T>> + Unpin> Listener<T, B> {
916
916
}
917
917
918
918
/// Wait until the provided deadline using the specified parker/unparker pair.
919
- #[ cfg( all( feature = "std" , not( target_family = "wasm" ) , ) ) ]
919
+ #[ cfg( all( feature = "std" , not( target_family = "wasm" ) ) ) ]
920
920
fn wait_with_parker (
921
921
self : Pin < & mut Self > ,
922
922
deadline : Option < Instant > ,
@@ -1078,23 +1078,23 @@ enum Task {
1078
1078
Waker ( Waker ) ,
1079
1079
1080
1080
/// An unparker that wakes up a thread.
1081
- #[ cfg( all( feature = "std" , not( target_family = "wasm" ) , ) ) ]
1081
+ #[ cfg( all( feature = "std" , not( target_family = "wasm" ) ) ) ]
1082
1082
Unparker ( Unparker ) ,
1083
1083
}
1084
1084
1085
1085
impl Task {
1086
1086
fn as_task_ref ( & self ) -> TaskRef < ' _ > {
1087
1087
match self {
1088
1088
Self :: Waker ( waker) => TaskRef :: Waker ( waker) ,
1089
- #[ cfg( all( feature = "std" , not( target_family = "wasm" ) , ) ) ]
1089
+ #[ cfg( all( feature = "std" , not( target_family = "wasm" ) ) ) ]
1090
1090
Self :: Unparker ( unparker) => TaskRef :: Unparker ( unparker) ,
1091
1091
}
1092
1092
}
1093
1093
1094
1094
fn wake ( self ) {
1095
1095
match self {
1096
1096
Self :: Waker ( waker) => waker. wake ( ) ,
1097
- #[ cfg( all( feature = "std" , not( target_family = "wasm" ) , ) ) ]
1097
+ #[ cfg( all( feature = "std" , not( target_family = "wasm" ) ) ) ]
1098
1098
Self :: Unparker ( unparker) => {
1099
1099
unparker. unpark ( ) ;
1100
1100
}
@@ -1115,7 +1115,7 @@ enum TaskRef<'a> {
1115
1115
Waker ( & ' a Waker ) ,
1116
1116
1117
1117
/// An unparker that wakes up a thread.
1118
- #[ cfg( all( feature = "std" , not( target_family = "wasm" ) , ) ) ]
1118
+ #[ cfg( all( feature = "std" , not( target_family = "wasm" ) ) ) ]
1119
1119
Unparker ( & ' a Unparker ) ,
1120
1120
}
1121
1121
@@ -1125,7 +1125,7 @@ impl TaskRef<'_> {
1125
1125
fn will_wake ( self , other : Self ) -> bool {
1126
1126
match ( self , other) {
1127
1127
( Self :: Waker ( a) , Self :: Waker ( b) ) => a. will_wake ( b) ,
1128
- #[ cfg( all( feature = "std" , not( target_family = "wasm" ) , ) ) ]
1128
+ #[ cfg( all( feature = "std" , not( target_family = "wasm" ) ) ) ]
1129
1129
( Self :: Unparker ( _) , Self :: Unparker ( _) ) => {
1130
1130
// TODO: Use unreleased will_unpark API.
1131
1131
false
@@ -1138,7 +1138,7 @@ impl TaskRef<'_> {
1138
1138
fn into_task ( self ) -> Task {
1139
1139
match self {
1140
1140
Self :: Waker ( waker) => Task :: Waker ( waker. clone ( ) ) ,
1141
- #[ cfg( all( feature = "std" , not( target_family = "wasm" ) , ) ) ]
1141
+ #[ cfg( all( feature = "std" , not( target_family = "wasm" ) ) ) ]
1142
1142
Self :: Unparker ( unparker) => Task :: Unparker ( unparker. clone ( ) ) ,
1143
1143
}
1144
1144
}
0 commit comments