From fcd1b204eb43972a87135d0975d406d23ffd066c Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Fri, 29 Nov 2019 18:31:21 +0100 Subject: [PATCH] Update dependencies --- Cargo.toml | 10 +++++----- src/lib.rs | 19 ++++++++++++++----- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index aaa4596c..1c5bd53c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,16 +14,16 @@ version = "0.3.0-beta.1" [dependencies] futures-preview = "=0.3.0-alpha.19" -http = "0.1.19" +http = "0.1.20" hyper = { version = "=0.13.0-alpha.4", features = ["unstable-stream"] } hyper-tls = { version = "=0.4.0-alpha.4", optional = true } -ruma-api = "0.11.0" -ruma-client-api = "0.4.0" +ruma-api = "0.12.0-alpha.1" +ruma-client-api = "0.5.0-alpha.1" ruma-events = "0.15.1" ruma-identifiers = "0.14.0" native-tls = { version = "0.2.3", optional = true } -serde = { version = "1.0.102", features = ["derive"] } -serde_json = "1.0.41" +serde = { version = "1.0.103", features = ["derive"] } +serde_json = "1.0.42" serde_urlencoded = "0.6.1" url = "2.1.0" diff --git a/src/lib.rs b/src/lib.rs index 5275c05e..a76132e1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -101,7 +101,7 @@ use hyper::{ use hyper_tls::HttpsConnector; #[cfg(feature = "hyper-tls")] use native_tls::Error as NativeTlsError; -use ruma_api::Endpoint; +use ruma_api::{Endpoint, Outgoing}; use url::Url; use crate::error::InnerError; @@ -305,8 +305,8 @@ where filter: Option, since: Option, set_presence: bool, - ) -> impl Stream> - + TryStream { + ) -> impl Stream> + + TryStream { use api::r0::sync::sync_events; // TODO: Is this really the way TryStreams are supposed to work? @@ -365,7 +365,14 @@ where pub fn request( &self, request: Request, - ) -> impl Future> { + ) -> impl Future::Incoming, Error>> + // We need to duplicate Endpoint's where clauses because the compiler is not smart enough yet. + // See https://github.com/rust-lang/rust/issues/54149 + where + Request::Incoming: TryFrom>, Error = ruma_api::Error>, + ::Incoming: + TryFrom>, Error = ruma_api::Error>, + { let client = self.0.clone(); async move { @@ -396,7 +403,9 @@ where let full_response = HttpResponse::from_parts(head, body.try_concat().await?.as_ref().to_owned()); - Ok(Request::Response::try_from(full_response)?) + Ok(::Incoming::try_from( + full_response, + )?) } } }