feat(lib): replace types with those from http crate

BREAKING CHANGE: `Method`, `Request`, `Response`, `StatusCode`,
  `Version`, and `Uri` have been replaced with types from the `http`
  crate. The `hyper::header` module is gone for now.

  Removed `Client::get`, since it needed to construct a `Request<B>`
  with an empty body. Just use `Client::request` instead.

  Removed `compat` cargo feature, and `compat` related API.
This commit is contained in:
Sean McArthur
2018-02-28 16:37:17 -08:00
parent a37e6b59e6
commit 3cd48b45fb
109 changed files with 1004 additions and 14411 deletions

View File

@@ -418,11 +418,11 @@ impl Service for MockConnector {
fn call(&self, uri: Uri) -> Self::Future {
use futures::future;
trace!("mock connect: {:?}", uri.as_ref());
trace!("mock connect: {}", uri);
let mut mocks = self.mocks.borrow_mut();
let mocks = mocks.get_mut(uri.as_ref())
.expect(&format!("unknown mocks uri: {:?}", uri.as_ref()));
assert!(!mocks.is_empty(), "no additional mocks for {:?}", uri.as_ref());
let mocks = mocks.get_mut(&uri.to_string())
.expect(&format!("unknown mocks uri: {}", uri));
assert!(!mocks.is_empty(), "no additional mocks for {}", uri);
future::ok(mocks.remove(0))
}
}