Skip to content

Commit e4fb4b6

Browse files
committed
update smol dependencies
Signed-off-by: Marc-Antoine Perennou <[email protected]>
1 parent 26f6198 commit e4fb4b6

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ futures-timer = { version = "3.0.2", optional = true }
8080
surf = { version = "1.0.3", optional = true }
8181

8282
[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 }
8787

8888
[target.'cfg(target_arch = "wasm32")'.dependencies]
8989
futures-timer = { version = "3.0.2", optional = true, features = ["wasm-bindgen"] }

src/task/executor.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ pub(crate) fn run<F, T>(future: F) -> T
2828
where
2929
F: Future<Output = T>,
3030
{
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))))
3232
}
3333

3434
pub(crate) fn run_global<F, T>(future: F) -> T
3535
where
3636
F: Future<Output = T>,
3737
{
38-
enter(|| GLOBAL_EXECUTOR.run(future))
38+
enter(|| async_io::block_on(GLOBAL_EXECUTOR.run(future)))
3939
}
4040

4141
/// Enters the tokio context if the `tokio` feature is enabled.

src/utils.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pub(crate) fn timer_after(dur: std::time::Duration) -> timer::Timer {
6969
#[cfg(all(not(target_os = "unknown"), feature = "default"))]
7070
once_cell::sync::Lazy::force(&crate::rt::RUNTIME);
7171

72-
Timer::new(dur)
72+
Timer::after(dur)
7373
}
7474

7575
#[cfg(any(
@@ -84,7 +84,7 @@ mod timer {
8484
pub(crate) struct Timer(futures_timer::Delay);
8585

8686
impl Timer {
87-
pub(crate) fn new(dur: std::time::Duration) -> Self {
87+
pub(crate) fn after(dur: std::time::Duration) -> Self {
8888
Timer(futures_timer::Delay::new(dur))
8989
}
9090
}

0 commit comments

Comments
 (0)