Skip to content

Commit

Permalink
Merge pull request #377 from arlyon/feature-buildrs
Browse files Browse the repository at this point in the history
Move feature check to build.rs
  • Loading branch information
arlyon committed May 9, 2023
2 parents 82a4fa8 + b90c417 commit 9bcd6a8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 22 deletions.
23 changes: 23 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -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'
]"
);
}
22 changes: 0 additions & 22 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9bcd6a8

Please sign in to comment.