Rename create_with_headers to create.

This commit is contained in:
Josh Matthews 2016-04-12 18:36:16 -04:00
parent a761f2bed4
commit 43369fa897
2 changed files with 27 additions and 27 deletions

View file

@ -249,7 +249,7 @@ impl HttpResponse for WrappedHttpResponse {
pub trait HttpRequestFactory {
type R: HttpRequest;
fn create_with_headers(&self, url: Url, method: Method, headers: Headers) -> Result<Self::R, LoadError>;
fn create(&self, url: Url, method: Method, headers: Headers) -> Result<Self::R, LoadError>;
}
pub struct NetworkHttpRequestFactory {
@ -259,8 +259,8 @@ pub struct NetworkHttpRequestFactory {
impl HttpRequestFactory for NetworkHttpRequestFactory {
type R = WrappedHttpRequest;
fn create_with_headers(&self, url: Url, method: Method, headers: Headers)
-> Result<WrappedHttpRequest, LoadError> {
fn create(&self, url: Url, method: Method, headers: Headers)
-> Result<WrappedHttpRequest, LoadError> {
let connection = Request::with_connector(method, url.clone(), &*self.connector);
if let Err(HttpError::Ssl(ref error)) = connection {
@ -665,8 +665,8 @@ pub fn obtain_response<A>(request_factory: &HttpRequestFactory<R=A>,
info!("{:?}", data);
}
let req = try!(request_factory.create_with_headers(connection_url.clone(), method.clone(),
headers.clone()));
let req = try!(request_factory.create(connection_url.clone(), method.clone(),
headers.clone()));
if cancel_listener.is_cancelled() {
return Err(LoadError::Cancelled(connection_url.clone(), "load cancelled".to_owned()));