From ee01a5373cd4949818e0e129061020d3386bafe7 Mon Sep 17 00:00:00 2001 From: FineFindus Date: Tue, 7 Jan 2025 20:48:32 +0100 Subject: [PATCH] feat: show error when neither tokio nor async-std are enabled Shows a compiler warning when neither tokio nor async-std are enabled. When both features are disabled, the project fails to compile, as the symbols cannot be resolved. --- src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 8b42da102..2b8881b39 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -8,6 +8,8 @@ #![doc = include_str!("../README.md")] #[cfg(all(all(feature = "tokio", feature = "async-std"), not(doc)))] compile_error!("You can't enable both async-std & tokio features at once"); +#[cfg(all(not(feature = "tokio"), not(feature = "async-std"), not(doc)))] +compile_error!("Either the `async-std` or the `tokio` feature has to be enabled"); /// Alias for a [`Result`] with the error type `ashpd::Error`. pub type Result = std::result::Result;