From 48693fccc3e7fff633441ddd644c804cef9ba4ae Mon Sep 17 00:00:00 2001 From: Marc-Antoine Perennou Date: Wed, 22 Jul 2020 09:13:16 +0200 Subject: [PATCH] switch to futures-lite Signed-off-by: Marc-Antoine Perennou --- Cargo.toml | 2 ++ src/fs/file.rs | 2 +- src/task/builder.rs | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 36322d99..1f880665 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,6 +27,7 @@ default = [ "async-io", "async-task", "blocking", + "futures-lite", "kv-log-macro", "log", "num_cpus", @@ -81,6 +82,7 @@ surf = { version = "1.0.3", optional = true } [target.'cfg(not(target_os = "unknown"))'.dependencies] async-io = { version = "0.1.5", optional = true } blocking = { version = "0.5.0", optional = true } +futures-lite = { version = "0.1.8", optional = true } smol = { version = "0.1.17", optional = true } [target.'cfg(target_arch = "wasm32")'.dependencies] diff --git a/src/fs/file.rs b/src/fs/file.rs index 2ff5643e..56d292b9 100644 --- a/src/fs/file.rs +++ b/src/fs/file.rs @@ -315,7 +315,7 @@ impl Drop for File { // non-blocking fashion, but our only other option here is losing data remaining in the // write cache. Good task schedulers should be resilient to occasional blocking hiccups in // file destructors so we don't expect this to be a common problem in practice. - let _ = smol::block_on(self.flush()); + let _ = futures_lite::future::block_on(self.flush()); } } diff --git a/src/task/builder.rs b/src/task/builder.rs index 0024f8ab..2fbcff92 100644 --- a/src/task/builder.rs +++ b/src/task/builder.rs @@ -169,7 +169,7 @@ impl Builder { // The first call should use run. smol::run(wrapped) } else { - smol::block_on(wrapped) + futures_lite::future::block_on(wrapped) }; num_nested_blocking.replace(num_nested_blocking.get() - 1); res