mirror of
https://github.com/async-rs/async-std.git
synced 2025-04-13 20:06:43 +00:00
update smol dependencies
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
This commit is contained in:
parent
26f6198065
commit
e4fb4b6128
3 changed files with 8 additions and 8 deletions
|
@ -80,10 +80,10 @@ futures-timer = { version = "3.0.2", optional = true }
|
|||
surf = { version = "1.0.3", optional = true }
|
||||
|
||||
[target.'cfg(not(target_os = "unknown"))'.dependencies]
|
||||
async-executor = { version = "0.1.2", features = ["async-io"], optional = true }
|
||||
async-io = { version = "0.1.8", optional = true }
|
||||
blocking = { version = "0.5.2", optional = true }
|
||||
futures-lite = { version = "0.1.8", optional = true }
|
||||
async-executor = { version = "0.2.0", optional = true }
|
||||
async-io = { version = "0.2.1", optional = true }
|
||||
blocking = { version = "0.6.0", optional = true }
|
||||
futures-lite = { version = "1.0.0", optional = true }
|
||||
|
||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||
futures-timer = { version = "3.0.2", optional = true, features = ["wasm-bindgen"] }
|
||||
|
|
|
@ -28,14 +28,14 @@ pub(crate) fn run<F, T>(future: F) -> T
|
|||
where
|
||||
F: Future<Output = T>,
|
||||
{
|
||||
EXECUTOR.with(|executor| enter(|| GLOBAL_EXECUTOR.enter(|| executor.borrow().run(future))))
|
||||
EXECUTOR.with(|executor| enter(|| async_io::block_on(executor.borrow().run(future))))
|
||||
}
|
||||
|
||||
pub(crate) fn run_global<F, T>(future: F) -> T
|
||||
where
|
||||
F: Future<Output = T>,
|
||||
{
|
||||
enter(|| GLOBAL_EXECUTOR.run(future))
|
||||
enter(|| async_io::block_on(GLOBAL_EXECUTOR.run(future)))
|
||||
}
|
||||
|
||||
/// Enters the tokio context if the `tokio` feature is enabled.
|
||||
|
|
|
@ -69,7 +69,7 @@ pub(crate) fn timer_after(dur: std::time::Duration) -> timer::Timer {
|
|||
#[cfg(all(not(target_os = "unknown"), feature = "default"))]
|
||||
once_cell::sync::Lazy::force(&crate::rt::RUNTIME);
|
||||
|
||||
Timer::new(dur)
|
||||
Timer::after(dur)
|
||||
}
|
||||
|
||||
#[cfg(any(
|
||||
|
@ -84,7 +84,7 @@ mod timer {
|
|||
pub(crate) struct Timer(futures_timer::Delay);
|
||||
|
||||
impl Timer {
|
||||
pub(crate) fn new(dur: std::time::Duration) -> Self {
|
||||
pub(crate) fn after(dur: std::time::Duration) -> Self {
|
||||
Timer(futures_timer::Delay::new(dur))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue