From b7570b2476ff605ef407b411c71790a79b0d4bdb Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Tue, 26 Mar 2019 22:33:01 -0700 Subject: [PATCH] remove unused code --- awc/src/builder.rs | 9 +++++---- awc/src/request.rs | 10 ++++------ awc/src/response.rs | 17 ----------------- 3 files changed, 9 insertions(+), 27 deletions(-) diff --git a/awc/src/builder.rs b/awc/src/builder.rs index 686948682..562ff2419 100644 --- a/awc/src/builder.rs +++ b/awc/src/builder.rs @@ -65,13 +65,14 @@ impl ClientBuilder { } /// Do not add default request headers. - /// By default `Accept-Encoding` and `User-Agent` headers are set. - pub fn skip_default_headers(mut self) -> Self { + /// By default `Date` and `User-Agent` headers are set. + pub fn no_default_headers(mut self) -> Self { self.default_headers = false; self } - /// Add default header. This header adds to every request. + /// Add default header. Headers adds byt this method + /// get added to every request. pub fn header(mut self, key: K, value: V) -> Self where HeaderName: HttpTryFrom, @@ -91,7 +92,7 @@ impl ClientBuilder { self } - /// Finish build process and create `Client`. + /// Finish build process and create `Client` instance. pub fn finish(self) -> Client { Client { connector: self.connector, diff --git a/awc/src/request.rs b/awc/src/request.rs index 16e42939c..c944c6ca3 100644 --- a/awc/src/request.rs +++ b/awc/src/request.rs @@ -141,13 +141,11 @@ impl ClientRequest { /// To override header use `set_header()` method. /// /// ```rust - /// # extern crate actix_http; - /// # - /// use actix_http::{client, http}; + /// use awc::{http, Client}; /// /// fn main() { /// # actix_rt::System::new("test").block_on(futures::future::lazy(|| { - /// let req = awc::Client::new() + /// let req = Client::new() /// .get("http://www.rust-lang.org") /// .header("X-TEST", "value") /// .header(http::header::CONTENT_TYPE, "application/json"); @@ -304,7 +302,7 @@ impl ClientRequest { } /// Do not add default request headers. - /// By default `Accept-Encoding` and `User-Agent` headers are set. + /// By default `Date` and `User-Agent` headers are set. pub fn no_default_headers(mut self) -> Self { self.default_headers = false; self @@ -394,7 +392,7 @@ impl ClientRequest { // user agent self.set_header_if_none( header::USER_AGENT, - concat!("actix-http/", env!("CARGO_PKG_VERSION")), + concat!("awc/", env!("CARGO_PKG_VERSION")), ) } else { self diff --git a/awc/src/response.rs b/awc/src/response.rs index abff771ce..03606a768 100644 --- a/awc/src/response.rs +++ b/awc/src/response.rs @@ -71,11 +71,6 @@ impl ClientResponse { &self.head } - #[inline] - pub(crate) fn head_mut(&mut self) -> &mut ResponseHead { - &mut self.head - } - /// Read the Request Version. #[inline] pub fn version(&self) -> Version { @@ -94,18 +89,6 @@ impl ClientResponse { &self.head().headers } - #[inline] - /// Returns mutable Request's headers. - pub fn headers_mut(&mut self) -> &mut HeaderMap { - &mut self.head_mut().headers - } - - /// Checks if a connection should be kept alive. - #[inline] - pub fn keep_alive(&self) -> bool { - self.head().keep_alive() - } - /// Set a body and return previous body value pub fn map_body(mut self, f: F) -> ClientResponse where