Skip to content

Commit

Permalink
update to hyper 0.13.2 and http 0.2
Browse files Browse the repository at this point in the history
Change-Id: I033e7d8976bdc502f22c45bfe065cd97d95870a9
  • Loading branch information
tamird committed Jun 3, 2020
1 parent 6968446 commit ea160a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ data-encoding = "2.0.0-rc.2"
derp = "0.0.13"
futures-executor = "0.3.1"
futures-io = "0.3.1"
futures-util = { version = "0.3.1", features = [ "compat", "io" ] }
http = "0.1"
hyper = { version = "0.12", default-features = false }
futures-util = { version = "0.3.1", features = [ "io" ] }
http = "0.2.0"
hyper = { version = "0.13.2", default-features = false, features = [ "stream" ] }
itoa = "0.4"
log = "0.4"
ring = { version = "0.16" }
Expand Down
9 changes: 3 additions & 6 deletions src/repository/http.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! Read-only Repository implementation backed by a web server.

use futures_io::AsyncRead;
use futures_util::compat::{Future01CompatExt, Stream01CompatExt};
use futures_util::future::{BoxFuture, FutureExt};
use futures_util::stream::TryStreamExt;
use http::{Response, StatusCode, Uri};
Expand Down Expand Up @@ -206,7 +205,7 @@ fn extend_uri(uri: Uri, prefix: &Option<Vec<String>>, components: &[String]) ->

impl<C, D> HttpRepository<C, D>
where
C: Connect + Sync + 'static,
C: Connect + Clone + Send + Sync + 'static,
D: DataInterchange,
{
async fn get<'a>(
Expand All @@ -222,7 +221,7 @@ where
.header("User-Agent", &*self.user_agent)
.body(Body::default())?;

let resp = self.client.request(req).compat().await?;
let resp = self.client.request(req).await?;
let status = resp.status();

if !status.is_success() {
Expand All @@ -242,7 +241,7 @@ where

impl<C, D> RepositoryProvider<D> for HttpRepository<C, D>
where
C: Connect + Sync + 'static,
C: Connect + Clone + Send + Sync + 'static,
D: DataInterchange + Send + Sync,
{
fn fetch_metadata<'a>(
Expand All @@ -260,7 +259,6 @@ where

let reader = resp
.into_body()
.compat()
.map_err(|err| io::Error::new(io::ErrorKind::Other, err))
.into_async_read()
.enforce_minimum_bitrate(self.min_bytes_per_second);
Expand All @@ -284,7 +282,6 @@ where

let reader = resp
.into_body()
.compat()
.map_err(|err| io::Error::new(io::ErrorKind::Other, err))
.into_async_read()
.enforce_minimum_bitrate(self.min_bytes_per_second);
Expand Down

0 comments on commit ea160a6

Please sign in to comment.