Skip to content

Commit bfa282f

Browse files
committed
Show compile_error if unusable feature combination is used
Certain features must be present for the compilation to have any use at all.
1 parent c4266ea commit bfa282f

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

payjoin-cli/src/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ use url::Url;
99
mod app;
1010
mod db;
1111

12+
#[cfg(not(any(feature = "v1", feature = "v2")))]
13+
compile_error!("At least one of the features ['v1', 'v2'] must be enabled");
14+
1215
#[tokio::main]
1316
async fn main() -> Result<()> {
1417
env_logger::init();

payjoin/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
//!
1818
//! **Use at your own risk. This crate has not yet been reviewed by independent Rust and Bitcoin security professionals.**
1919
20+
#[cfg(not(any(feature = "directory", feature = "v1", feature = "v2")))]
21+
compile_error!("At least one of the features ['directory', 'v1', 'v2'] must be enabled");
22+
2023
#[cfg(feature = "_core")]
2124
pub extern crate bitcoin;
2225

0 commit comments

Comments
 (0)