mirror of
https://github.com/async-rs/async-std.git
synced 2025-04-08 01:16:41 +00:00
switch to futures-lite
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
This commit is contained in:
parent
2fe087bd0a
commit
48693fccc3
3 changed files with 4 additions and 2 deletions
|
@ -27,6 +27,7 @@ default = [
|
||||||
"async-io",
|
"async-io",
|
||||||
"async-task",
|
"async-task",
|
||||||
"blocking",
|
"blocking",
|
||||||
|
"futures-lite",
|
||||||
"kv-log-macro",
|
"kv-log-macro",
|
||||||
"log",
|
"log",
|
||||||
"num_cpus",
|
"num_cpus",
|
||||||
|
@ -81,6 +82,7 @@ surf = { version = "1.0.3", optional = true }
|
||||||
[target.'cfg(not(target_os = "unknown"))'.dependencies]
|
[target.'cfg(not(target_os = "unknown"))'.dependencies]
|
||||||
async-io = { version = "0.1.5", optional = true }
|
async-io = { version = "0.1.5", optional = true }
|
||||||
blocking = { version = "0.5.0", optional = true }
|
blocking = { version = "0.5.0", optional = true }
|
||||||
|
futures-lite = { version = "0.1.8", optional = true }
|
||||||
smol = { version = "0.1.17", optional = true }
|
smol = { version = "0.1.17", optional = true }
|
||||||
|
|
||||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||||
|
|
|
@ -315,7 +315,7 @@ impl Drop for File {
|
||||||
// non-blocking fashion, but our only other option here is losing data remaining in the
|
// 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
|
// 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.
|
// 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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -169,7 +169,7 @@ impl Builder {
|
||||||
// The first call should use run.
|
// The first call should use run.
|
||||||
smol::run(wrapped)
|
smol::run(wrapped)
|
||||||
} else {
|
} else {
|
||||||
smol::block_on(wrapped)
|
futures_lite::future::block_on(wrapped)
|
||||||
};
|
};
|
||||||
num_nested_blocking.replace(num_nested_blocking.get() - 1);
|
num_nested_blocking.replace(num_nested_blocking.get() - 1);
|
||||||
res
|
res
|
||||||
|
|
Loading…
Reference in a new issue