Fix up cargo test --no-default-features. (#75)

Adds some feature guards, and removes an unnecessary feature guard
around a call to connect_https (there's an implementation available for
non-TLS that returns UnknownScheme).

Also, remove unnecessary agent.state() method that was only available in
TLS builds. The state field is directly accessible within the crate, and
can be used in both TLS and non-TLS builds.

Co-authored-by: Martin Algesten <martin@algesten.se>
This commit is contained in:
Jacob Hoffman-AndrewsandMartin Algesten authored and GitHub committed 2020-06-21 09:54:03 +02:00
1 parent e366c8fcd0
commit 7adbd57308
7 files changed
+13 -18

No files matched your search

+1 -1
View File
@@ -99,7 +99,7 @@ fn connection_reuse() {
resp.into_reader().read_to_end(&mut buf).unwrap();
{
let mut guard_state = agent.state().lock().unwrap();
let mut guard_state = agent.state.lock().unwrap();
let mut state = guard_state.take().unwrap();
assert!(state.pool().len() > 0);
}
+1 -1
View File
@@ -39,7 +39,7 @@ fn agent_pool() {
assert_eq!(len, 1000);
{
let mut lock = agent.state().lock().unwrap();
let mut lock = agent.state.lock().unwrap();
let state = lock.as_mut().unwrap();
let pool = state.pool();
assert_eq!(pool.len(), 1);