1
1
mirror of https://github.com/wez/wezterm.git synced 2025-01-03 11:11:43 +03:00

deps: remove async-std dep

We were only using block_on from it, which we can call from the
underlying async_io crate.

Notably, removing async_std from the deps avoids async-global-executor
being pulled in and spawning nproc threads that are never used by
wezterm.
This commit is contained in:
Wez Furlong 2022-11-01 07:05:33 -07:00
parent 43f2265ef1
commit f726a2075e
5 changed files with 12 additions and 94 deletions

98
Cargo.lock generated
View File

@ -132,33 +132,18 @@ dependencies = [
"futures-lite",
]
[[package]]
name = "async-global-executor"
version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0da5b41ee986eed3f524c380e6d64965aea573882a8907682ad100f7859305ca"
dependencies = [
"async-channel",
"async-executor",
"async-io",
"async-lock",
"blocking",
"futures-lite",
"once_cell",
]
[[package]]
name = "async-io"
version = "1.9.0"
version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "83e21f3a490c72b3b0cf44962180e60045de2925d8dff97918f7ee43c8f637c7"
checksum = "e8121296a9f05be7f34aa4196b1747243b3b62e048bb7906f644f3fbfc490cf7"
dependencies = [
"async-lock",
"autocfg",
"concurrent-queue",
"futures-lite",
"libc",
"log",
"once_cell",
"parking",
"polling",
"slab",
@ -169,11 +154,12 @@ dependencies = [
[[package]]
name = "async-lock"
version = "2.5.0"
version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e97a171d191782fba31bb902b14ad94e24a68145032b7eedf871ab0bc0d077b6"
checksum = "c8101efe8695a6c17e02911402145357e718ac92d3ff88ae8419e84b1707b685"
dependencies = [
"event-listener",
"futures-lite",
]
[[package]]
@ -217,32 +203,6 @@ dependencies = [
"syn",
]
[[package]]
name = "async-std"
version = "1.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d"
dependencies = [
"async-channel",
"async-global-executor",
"async-io",
"async-lock",
"crossbeam-utils",
"futures-channel",
"futures-core",
"futures-io",
"futures-lite",
"gloo-timers",
"kv-log-macro",
"log",
"memchr",
"once_cell",
"pin-project-lite",
"pin-utils",
"slab",
"wasm-bindgen-futures",
]
[[package]]
name = "async-task"
version = "4.3.0"
@ -979,16 +939,6 @@ dependencies = [
"memchr",
]
[[package]]
name = "ctor"
version = "0.1.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096"
dependencies = [
"quote",
"syn",
]
[[package]]
name = "cty"
version = "0.2.2"
@ -1790,18 +1740,6 @@ dependencies = [
"walkdir",
]
[[package]]
name = "gloo-timers"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5fb7d06c1c8cc2a29bee7ec961009a0b2caa0793ee4900c2ffb348734ba1c8f9"
dependencies = [
"futures-channel",
"futures-core",
"js-sys",
"wasm-bindgen",
]
[[package]]
name = "governor"
version = "0.4.2"
@ -2264,15 +2202,6 @@ dependencies = [
"libc",
]
[[package]]
name = "kv-log-macro"
version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f"
dependencies = [
"log",
]
[[package]]
name = "lab"
version = "0.11.0"
@ -2469,7 +2398,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e"
dependencies = [
"cfg-if 1.0.0",
"value-bag",
]
[[package]]
@ -3617,7 +3545,7 @@ version = "0.2.0"
dependencies = [
"anyhow",
"async-executor",
"async-std",
"async-io",
"async-task",
"flume",
"lazy_static",
@ -5166,16 +5094,6 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "936e4b492acfd135421d8dca4b1aa80a7bfc26e702ef3af710e0752684df5372"
[[package]]
name = "value-bag"
version = "1.0.0-alpha.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2209b78d1249f7e6f3293657c9779fe31ced465df091bbd433a1cf88e916ec55"
dependencies = [
"ctor",
"version_check",
]
[[package]]
name = "varbincode"
version = "0.1.0"
@ -5816,7 +5734,7 @@ dependencies = [
name = "wezterm-toast-notification"
version = "0.1.0"
dependencies = [
"async-std",
"async-io",
"cocoa",
"core-foundation 0.7.0",
"futures-util",

View File

@ -6,8 +6,8 @@ edition = "2018"
[dependencies]
async-task = "4.0"
async-std = "1.4"
async-executor = "1.4"
async-io = "1.10"
anyhow = "1.0"
thiserror = "1.0"
lazy_static = "1.4"

View File

@ -185,7 +185,7 @@ where
}
/// Block the current thread until the passed future completes.
pub use async_std::task::block_on;
pub use async_io::block_on;
pub struct SimpleExecutor {
rx: Receiver<SpawnFunc>,

View File

@ -15,7 +15,7 @@ log = "0.4"
serde = {version="1.0", features = ["derive"]}
zbus = "3.0"
zvariant = "3.6"
async-std = "1.4"
async-io = "1.10"
futures-util = "0.3"
[target.'cfg(target_os="macos")'.dependencies]

View File

@ -157,7 +157,7 @@ pub fn show_notif(notif: ToastNotification) -> Result<(), Box<dyn std::error::Er
// Run this in a separate thread as we don't know if dbus or the notification
// service on the other end are up, and we'd otherwise block for some time.
std::thread::spawn(move || {
let res = async_std::task::block_on(async move { show_notif_impl(notif).await });
let res = async_io::block_on(async move { show_notif_impl(notif).await });
if let Err(err) = res {
log::error!("while showing notification: {:#}", err);
}