diff --git a/concurrency/Cargo.toml b/concurrency/Cargo.toml index edfbc8a..c2845a9 100644 --- a/concurrency/Cargo.toml +++ b/concurrency/Cargo.toml @@ -10,16 +10,9 @@ spawned-rt = { workspace = true } tracing = { workspace = true } futures = "0.3.1" thiserror = "2.0.12" -pin-project-lite = { version = "0.2", optional = true } +pin-project-lite = "0.2" [dev-dependencies] # This tokio imports are only used in tests, we should not use them in the library code. tokio-stream = { version = "0.1.17" } tokio = { version = "1", features = ["full"] } - -[lib] -path = "./src/lib.rs" - -[features] -# Enable this to log warnings when non-blocking GenServers block the runtime for too much time -warn-on-block = ["dep:pin-project-lite"] diff --git a/concurrency/src/tasks/gen_server.rs b/concurrency/src/tasks/gen_server.rs index 3c05b04..7b2fb15 100644 --- a/concurrency/src/tasks/gen_server.rs +++ b/concurrency/src/tasks/gen_server.rs @@ -41,7 +41,7 @@ impl GenServerHandle { } }; - #[cfg(feature = "warn-on-block")] + #[cfg(debug_assertions)] // Optionally warn if the GenServer future blocks for too much time let inner_future = warn_on_block::WarnOnBlocking::new(inner_future); @@ -300,7 +300,7 @@ pub trait GenServer: Send + Sized { } } -#[cfg(feature = "warn-on-block")] +#[cfg(debug_assertions)] mod warn_on_block { use super::*;