From 6f1c5dd7344e6266fd60d4eec4f0b085b24d97b2 Mon Sep 17 00:00:00 2001 From: Evan Rittenhouse Date: Wed, 24 Apr 2024 09:39:20 -0500 Subject: [PATCH] Gate async socket behind feature --- dgram/Cargo.toml | 5 ++++- dgram/src/lib.rs | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/dgram/Cargo.toml b/dgram/Cargo.toml index f40427405b..c72e93a358 100644 --- a/dgram/Cargo.toml +++ b/dgram/Cargo.toml @@ -3,8 +3,11 @@ name = "dgram" version = "0.1.0" edition = "2021" +[features] +async = ["dep:tokio"] + [dependencies] libc = "0.2.76" nix = "0.26.2" smallvec = { version = "1.10", features = ["union"] } -tokio = { version = "1.29", features = ["full", "test-util"] } +tokio = { version = "1.29", features = ["full", "test-util"], optional = true } diff --git a/dgram/src/lib.rs b/dgram/src/lib.rs index 88159beb17..a484cce649 100644 --- a/dgram/src/lib.rs +++ b/dgram/src/lib.rs @@ -1,3 +1,4 @@ +#[cfg(feature = "async")] pub mod async_socket; pub mod socket; pub mod syscalls;