style(client): change instances of method::Method to Method

This commit is contained in:
Sean McArthur
2015-12-19 13:59:33 -08:00
parent 6cb35bc7cf
commit 69adbd1914

View File

@@ -6,7 +6,7 @@ use std::time::Duration;
use url::Url; use url::Url;
use method::{self, Method}; use method::Method;
use header::Headers; use header::Headers;
use header::Host; use header::Host;
use net::{NetworkStream, NetworkConnector, DefaultConnector, Fresh, Streaming}; use net::{NetworkStream, NetworkConnector, DefaultConnector, Fresh, Streaming};
@@ -28,7 +28,7 @@ pub struct Request<W> {
message: Box<HttpMessage>, message: Box<HttpMessage>,
headers: Headers, headers: Headers,
method: method::Method, method: Method,
_marker: PhantomData<W>, _marker: PhantomData<W>,
} }
@@ -40,7 +40,7 @@ impl<W> Request<W> {
/// Read the Request method. /// Read the Request method.
#[inline] #[inline]
pub fn method(&self) -> method::Method { self.method.clone() } pub fn method(&self) -> Method { self.method.clone() }
/// Set the write timeout. /// Set the write timeout.
#[inline] #[inline]
@@ -59,7 +59,7 @@ impl Request<Fresh> {
/// Create a new `Request<Fresh>` that will use the given `HttpMessage` for its communication /// Create a new `Request<Fresh>` that will use the given `HttpMessage` for its communication
/// with the server. This implies that the given `HttpMessage` instance has already been /// with the server. This implies that the given `HttpMessage` instance has already been
/// properly initialized by the caller (e.g. a TCP connection's already established). /// properly initialized by the caller (e.g. a TCP connection's already established).
pub fn with_message(method: method::Method, url: Url, message: Box<HttpMessage>) pub fn with_message(method: Method, url: Url, message: Box<HttpMessage>)
-> ::Result<Request<Fresh>> { -> ::Result<Request<Fresh>> {
let (host, port) = try!(get_host_and_port(&url)); let (host, port) = try!(get_host_and_port(&url));
let mut headers = Headers::new(); let mut headers = Headers::new();
@@ -79,13 +79,13 @@ impl Request<Fresh> {
} }
/// Create a new client request. /// Create a new client request.
pub fn new(method: method::Method, url: Url) -> ::Result<Request<Fresh>> { pub fn new(method: Method, url: Url) -> ::Result<Request<Fresh>> {
let mut conn = DefaultConnector::default(); let mut conn = DefaultConnector::default();
Request::with_connector(method, url, &mut conn) Request::with_connector(method, url, &mut conn)
} }
/// Create a new client request with a specific underlying NetworkStream. /// Create a new client request with a specific underlying NetworkStream.
pub fn with_connector<C, S>(method: method::Method, url: Url, connector: &C) pub fn with_connector<C, S>(method: Method, url: Url, connector: &C)
-> ::Result<Request<Fresh>> where -> ::Result<Request<Fresh>> where
C: NetworkConnector<Stream=S>, C: NetworkConnector<Stream=S>,
S: Into<Box<NetworkStream + Send>> { S: Into<Box<NetworkStream + Send>> {