Fix cfg for test
Fix up cfg attributes to work on an xor basis. Previously, the cfg(any()) attributes would cause issues when both native-tls and tls features were enabled. Now, https functions and enum variants will only be created when tls xor native-tls are enabled. Additionally, a compile error has been added for when both tls and native-tls features are enabled.
This commit is contained in:
@@ -181,6 +181,12 @@ pub fn patch(path: &str) -> Request {
|
||||
request("PATCH", path)
|
||||
}
|
||||
|
||||
// Compilation error when both tls and native-tls features are enabled
|
||||
#[cfg(all(feature = "tls", feature = "native-tls"))]
|
||||
std::compile_error!(
|
||||
"You have both the \"tls\" and \"native-tls\" features enabled on ureq. Please disable one of these features."
|
||||
);
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
Reference in New Issue
Block a user