Use less verbose syntax for associated types.

This commit is contained in:
Jimmy Cuadra 2017-05-12 00:27:07 -07:00
parent fafe30fdec
commit b6f0d8d8b4

View File

@ -50,11 +50,11 @@ impl Client {
/// Makes a request to a Matrix API endpoint. /// Makes a request to a Matrix API endpoint.
pub fn request<E>(&self, request: <E as Endpoint>::Request) pub fn request<E>(&self, request: <E as Endpoint>::Request)
-> impl Future<Item = <E as Endpoint>::Response, Error = Error> -> impl Future<Item = E::Response, Error = Error>
where E: Endpoint, where E: Endpoint,
<E as Endpoint>::Response: 'static, E::Response: 'static,
Error: From<<<E as Endpoint>::Request as TryInto<HyperRequest>>::Error>, Error: From<<E::Request as TryInto<HyperRequest>>::Error>,
Error: From<<<E as Endpoint>::Response as TryFrom<HyperResponse>>::Error> { Error: From<<E::Response as TryFrom<HyperResponse>>::Error> {
let cloned_hyper = self.hyper.clone(); let cloned_hyper = self.hyper.clone();
request request