From 8d06be0f45aa645ce0e491a21cae33d4acc08b43 Mon Sep 17 00:00:00 2001 From: JonathanWoollett-Light Date: Sat, 18 Mar 2023 20:17:08 +0000 Subject: [PATCH 1/2] fix: Move feature check to `build.rs` --- build.rs | 23 +++++++++++++++++++++++ src/lib.rs | 22 ---------------------- 2 files changed, 23 insertions(+), 22 deletions(-) create mode 100644 build.rs diff --git a/build.rs b/build.rs new file mode 100644 index 000000000..ffc164650 --- /dev/null +++ b/build.rs @@ -0,0 +1,23 @@ +fn main() { + #[cfg(not(any( + feature = "runtime-tokio-hyper", + feature = "runtime-tokio-hyper-rustls", + feature = "runtime-tokio-hyper-rustls-webpki", + feature = "runtime-blocking", + feature = "runtime-blocking-rustls", + feature = "runtime-blocking-rustls-webpki", + feature = "runtime-async-std-surf", + )))] + compile_error!( + r"one of the following runtime features must be enabled: + [ + 'runtime-tokio-hyper', + 'runtime-tokio-hyper-rustls', + 'runtime-tokio-hyper-rustls-webpki', + 'runtime-blocking', + 'runtime-blocking-rustls', + 'runtime-blocking-rustls-webpki', + 'runtime-async-std-surf' + ]" + ); +} \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index e83b56b10..11bcab1ec 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -61,28 +61,6 @@ // a runtime feature, but that does not seem currently possible: // https://github.com/rust-lang/rust/issues/68838 -#[cfg(not(any( - feature = "runtime-tokio-hyper", - feature = "runtime-tokio-hyper-rustls", - feature = "runtime-tokio-hyper-rustls-webpki", - feature = "runtime-blocking", - feature = "runtime-blocking-rustls", - feature = "runtime-blocking-rustls-webpki", - feature = "runtime-async-std-surf", -)))] -compile_error!( - r"one of the following runtime features must be enabled: - [ - 'runtime-tokio-hyper', - 'runtime-tokio-hyper-rustls', - 'runtime-tokio-hyper-rustls-webpki', - 'runtime-blocking', - 'runtime-blocking-rustls', - 'runtime-blocking-rustls-webpki', - 'runtime-async-std-surf' - ]" -); - mod client; mod error; mod ids; From b90c4172844ec67c39bfd96ea570f21a1933229e Mon Sep 17 00:00:00 2001 From: Alexander Lyon Date: Tue, 9 May 2023 21:50:02 +0100 Subject: [PATCH 2/2] run cargo make fmt --- build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.rs b/build.rs index ffc164650..52fd48b1e 100644 --- a/build.rs +++ b/build.rs @@ -20,4 +20,4 @@ fn main() { 'runtime-async-std-surf' ]" ); -} \ No newline at end of file +}