Skip to content

Commit

Permalink
feat: show error when neither tokio nor async-std are enabled
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
FineFindus authored and bilelmoussaoui committed Jan 7, 2025
1 parent c26bcd4 commit ee01a53
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T> = std::result::Result<T, Error>;
Expand Down

0 comments on commit ee01a53

Please sign in to comment.