Fix style issues reported by clippy and rustfmt.

This commit is contained in:
Jimmy Cuadra 2017-01-16 23:15:25 -08:00
parent 324fc5dc0d
commit 1492147875
3 changed files with 6 additions and 6 deletions

View File

@ -15,7 +15,7 @@ pub enum Error {
/// An error when serializing a query string value. /// An error when serializing a query string value.
SerdeUrlEncodedSerialize(SerdeUrlEncodedSerializeError), SerdeUrlEncodedSerialize(SerdeUrlEncodedSerializeError),
/// Queried endpoint requires authentication but was called on an anonymous client /// Queried endpoint requires authentication but was called on an anonymous client
AuthenticationRequired AuthenticationRequired,
} }
impl From<HyperError> for Error { impl From<HyperError> for Error {

View File

@ -1,4 +1,4 @@
//! Crate ruma_client is a [Matrix](https://matrix.org/) client library. //! Crate `ruma_client` is a [Matrix](https://matrix.org/) client library.
#![deny(missing_debug_implementations)] #![deny(missing_debug_implementations)]
#![deny(missing_docs)] #![deny(missing_docs)]
@ -15,7 +15,7 @@ extern crate url;
use std::fmt::Debug; use std::fmt::Debug;
use hyper::client::{Client as HyperClient, DefaultConnector, Request as HyperRequest}; use hyper::client::{Client as HyperClient, HttpConnector, Request as HyperRequest};
use hyper::Method as HyperMethod; use hyper::Method as HyperMethod;
use ruma_client_api::{Endpoint, Method}; use ruma_client_api::{Endpoint, Method};
use ruma_client_api::unversioned::get_supported_versions; use ruma_client_api::unversioned::get_supported_versions;
@ -34,7 +34,7 @@ mod session;
#[derive(Debug)] #[derive(Debug)]
pub struct Client { pub struct Client {
homeserver_url: Url, homeserver_url: Url,
hyper: HyperClient<DefaultConnector>, hyper: HyperClient<HttpConnector>,
session: Option<Session>, session: Option<Session>,
} }
@ -88,7 +88,7 @@ impl Client {
if let Some(ref session) = self.session { if let Some(ref session) = self.session {
url.query_pairs_mut().append_pair("access_token", &session.access_token); url.query_pairs_mut().append_pair("access_token", &session.access_token);
} else { } else {
return Err(Error::AuthenticationRequired) return Err(Error::AuthenticationRequired);
} }
} }

View File

@ -4,7 +4,7 @@ use std::marker::PhantomData;
use futures::{Async, Future, Poll, Stream}; use futures::{Async, Future, Poll, Stream};
use hyper::client::{FutureResponse as HyperFutureResponse, Response as HyperResponse}; use hyper::client::{FutureResponse as HyperFutureResponse, Response as HyperResponse};
use hyper::{Error as HyperError}; use hyper::Error as HyperError;
use hyper::header::Headers; use hyper::header::Headers;
use hyper::status::StatusCode; use hyper::status::StatusCode;
use hyper::HttpVersion; use hyper::HttpVersion;