Update dependencies
This commit is contained in:
parent
9e097539e4
commit
fcd1b204eb
10
Cargo.toml
10
Cargo.toml
@ -14,16 +14,16 @@ version = "0.3.0-beta.1"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
futures-preview = "=0.3.0-alpha.19"
|
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 = { version = "=0.13.0-alpha.4", features = ["unstable-stream"] }
|
||||||
hyper-tls = { version = "=0.4.0-alpha.4", optional = true }
|
hyper-tls = { version = "=0.4.0-alpha.4", optional = true }
|
||||||
ruma-api = "0.11.0"
|
ruma-api = "0.12.0-alpha.1"
|
||||||
ruma-client-api = "0.4.0"
|
ruma-client-api = "0.5.0-alpha.1"
|
||||||
ruma-events = "0.15.1"
|
ruma-events = "0.15.1"
|
||||||
ruma-identifiers = "0.14.0"
|
ruma-identifiers = "0.14.0"
|
||||||
native-tls = { version = "0.2.3", optional = true }
|
native-tls = { version = "0.2.3", optional = true }
|
||||||
serde = { version = "1.0.102", features = ["derive"] }
|
serde = { version = "1.0.103", features = ["derive"] }
|
||||||
serde_json = "1.0.41"
|
serde_json = "1.0.42"
|
||||||
serde_urlencoded = "0.6.1"
|
serde_urlencoded = "0.6.1"
|
||||||
url = "2.1.0"
|
url = "2.1.0"
|
||||||
|
|
||||||
|
19
src/lib.rs
19
src/lib.rs
@ -101,7 +101,7 @@ use hyper::{
|
|||||||
use hyper_tls::HttpsConnector;
|
use hyper_tls::HttpsConnector;
|
||||||
#[cfg(feature = "hyper-tls")]
|
#[cfg(feature = "hyper-tls")]
|
||||||
use native_tls::Error as NativeTlsError;
|
use native_tls::Error as NativeTlsError;
|
||||||
use ruma_api::Endpoint;
|
use ruma_api::{Endpoint, Outgoing};
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
use crate::error::InnerError;
|
use crate::error::InnerError;
|
||||||
@ -305,8 +305,8 @@ where
|
|||||||
filter: Option<api::r0::sync::sync_events::Filter>,
|
filter: Option<api::r0::sync::sync_events::Filter>,
|
||||||
since: Option<String>,
|
since: Option<String>,
|
||||||
set_presence: bool,
|
set_presence: bool,
|
||||||
) -> impl Stream<Item = Result<api::r0::sync::sync_events::Response, Error>>
|
) -> impl Stream<Item = Result<api::r0::sync::sync_events::IncomingResponse, Error>>
|
||||||
+ TryStream<Ok = api::r0::sync::sync_events::Response, Error = Error> {
|
+ TryStream<Ok = api::r0::sync::sync_events::IncomingResponse, Error = Error> {
|
||||||
use api::r0::sync::sync_events;
|
use api::r0::sync::sync_events;
|
||||||
|
|
||||||
// TODO: Is this really the way TryStreams are supposed to work?
|
// TODO: Is this really the way TryStreams are supposed to work?
|
||||||
@ -365,7 +365,14 @@ where
|
|||||||
pub fn request<Request: Endpoint>(
|
pub fn request<Request: Endpoint>(
|
||||||
&self,
|
&self,
|
||||||
request: Request,
|
request: Request,
|
||||||
) -> impl Future<Output = Result<Request::Response, Error>> {
|
) -> impl Future<Output = Result<<Request::Response as Outgoing>::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<http::Request<Vec<u8>>, Error = ruma_api::Error>,
|
||||||
|
<Request::Response as Outgoing>::Incoming:
|
||||||
|
TryFrom<http::Response<Vec<u8>>, Error = ruma_api::Error>,
|
||||||
|
{
|
||||||
let client = self.0.clone();
|
let client = self.0.clone();
|
||||||
|
|
||||||
async move {
|
async move {
|
||||||
@ -396,7 +403,9 @@ where
|
|||||||
let full_response =
|
let full_response =
|
||||||
HttpResponse::from_parts(head, body.try_concat().await?.as_ref().to_owned());
|
HttpResponse::from_parts(head, body.try_concat().await?.as_ref().to_owned());
|
||||||
|
|
||||||
Ok(Request::Response::try_from(full_response)?)
|
Ok(<Request::Response as Outgoing>::Incoming::try_from(
|
||||||
|
full_response,
|
||||||
|
)?)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user