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:
k3d3
2020-04-13 22:06:01 -04:00
committed by Martin Algesten
parent 9f7f712dde
commit de3416e260
4 changed files with 45 additions and 17 deletions

View File

@@ -1,7 +1,8 @@
#[cfg(all(test, any(feature = "tls", feature = "native-tls")))]
use std::io::Read;
#[cfg(all(test, any(feature = "tls", feature = "native-tls")))]
#[cfg(any(feature = "tls", feature = "native-tls"))]
#[test]
fn tls_connection_close() {
let agent = ureq::Agent::default().build();
let resp = agent