File tree 3 files changed +8
-8
lines changed
3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -80,10 +80,10 @@ futures-timer = { version = "3.0.2", optional = true }
80
80
surf = { version = " 1.0.3" , optional = true }
81
81
82
82
[target .'cfg(not(target_os = "unknown"))' .dependencies ]
83
- async-executor = { version = " 0.1.2 " , features = [ " async-io " ] , optional = true }
84
- async-io = { version = " 0.1.8 " , optional = true }
85
- blocking = { version = " 0.5.2 " , optional = true }
86
- futures-lite = { version = " 0.1.8 " , optional = true }
83
+ async-executor = { version = " 0.2.0 " , optional = true }
84
+ async-io = { version = " 0.2.1 " , optional = true }
85
+ blocking = { version = " 0.6.0 " , optional = true }
86
+ futures-lite = { version = " 1.0.0 " , optional = true }
87
87
88
88
[target .'cfg(target_arch = "wasm32")' .dependencies ]
89
89
futures-timer = { version = " 3.0.2" , optional = true , features = [" wasm-bindgen" ] }
Original file line number Diff line number Diff line change @@ -28,14 +28,14 @@ pub(crate) fn run<F, T>(future: F) -> T
28
28
where
29
29
F : Future < Output = T > ,
30
30
{
31
- EXECUTOR . with ( |executor| enter ( || GLOBAL_EXECUTOR . enter ( || executor. borrow ( ) . run ( future) ) ) )
31
+ EXECUTOR . with ( |executor| enter ( || async_io :: block_on ( executor. borrow ( ) . run ( future) ) ) )
32
32
}
33
33
34
34
pub ( crate ) fn run_global < F , T > ( future : F ) -> T
35
35
where
36
36
F : Future < Output = T > ,
37
37
{
38
- enter ( || GLOBAL_EXECUTOR . run ( future) )
38
+ enter ( || async_io :: block_on ( GLOBAL_EXECUTOR . run ( future) ) )
39
39
}
40
40
41
41
/// Enters the tokio context if the `tokio` feature is enabled.
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ pub(crate) fn timer_after(dur: std::time::Duration) -> timer::Timer {
69
69
#[ cfg( all( not( target_os = "unknown" ) , feature = "default" ) ) ]
70
70
once_cell:: sync:: Lazy :: force ( & crate :: rt:: RUNTIME ) ;
71
71
72
- Timer :: new ( dur)
72
+ Timer :: after ( dur)
73
73
}
74
74
75
75
#[ cfg( any(
@@ -84,7 +84,7 @@ mod timer {
84
84
pub ( crate ) struct Timer ( futures_timer:: Delay ) ;
85
85
86
86
impl Timer {
87
- pub ( crate ) fn new ( dur : std:: time:: Duration ) -> Self {
87
+ pub ( crate ) fn after ( dur : std:: time:: Duration ) -> Self {
88
88
Timer ( futures_timer:: Delay :: new ( dur) )
89
89
}
90
90
}
You can’t perform that action at this time.
0 commit comments