From 221ea3d3e20d4763f8f0eb1155f0ee461a3ce36c Mon Sep 17 00:00:00 2001 From: David Craven Date: Tue, 28 Dec 2021 15:07:42 +0100 Subject: [PATCH] Don't depend on async-std --- rtnetlink/Cargo.toml | 4 ++-- rtnetlink/src/ns.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rtnetlink/Cargo.toml b/rtnetlink/Cargo.toml index 36ab9bf6..20e21048 100644 --- a/rtnetlink/Cargo.toml +++ b/rtnetlink/Cargo.toml @@ -15,7 +15,7 @@ description = "manipulate linux networking resources via netlink" test_as_root = [] default = ["tokio_socket"] tokio_socket = ["netlink-proto/tokio_socket", "tokio"] -smol_socket = ["netlink-proto/smol_socket", "async-std"] +smol_socket = ["netlink-proto/smol_socket", "async-global-executor"] [dependencies] futures = "0.3.11" @@ -25,7 +25,7 @@ netlink-packet-route = "0.9" netlink-proto = { default-features = false, version = "0.8" } nix = "0.22.0" tokio = { version = "1.0.1", features = ["rt"], optional = true} -async-std = { version = "1.9.0", features = ["unstable"], optional = true} +async-global-executor = { version = "2.0.2", optional = true } [dev-dependencies] env_logger = "0.8.2" diff --git a/rtnetlink/src/ns.rs b/rtnetlink/src/ns.rs index 489a6531..cff40126 100644 --- a/rtnetlink/src/ns.rs +++ b/rtnetlink/src/ns.rs @@ -20,7 +20,7 @@ where F: FnOnce() -> R + Send + 'static, R: Send + 'static, { - async_std::task::spawn_blocking(fut).await + async_global_executor::spawn_blocking(fut).await } // only tokio enabled, so use tokio